feat(openapi): document constrained route params

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-08-02 20:47:18 -05:00
1 parent 9a61ba8646
commit a2acec69bf
4 files changed
+56 -13

No files matched your search

+5
View File
@@ -17,6 +17,11 @@ const route = (method: string, pattern: string): RouteDef => ({
});
describe('matchPattern', () => {
it('matches the root pattern only at root', () => {
expect(matchPattern('/', '/')).toEqual({});
expect(matchPattern('/', '/users')).toBeUndefined();
});
it('matches static and :param segments, decoding params', () => {
expect(matchPattern('/users/:id', '/users/a%20b')).toEqual({ id: 'a b' });
expect(matchPattern('/users/:id', '/users')).toBeUndefined();