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

+2 -2
View File
@@ -1,6 +1,6 @@
import type { RouteDef, MatchedRoute } from './types';
type CompiledSegment =
export type CompiledSegment =
| { kind: 'static'; value: string }
| { kind: 'param'; name: string; constraint?: RegExp; constraintSource?: string }
| { kind: 'catchAll'; name: string };
@@ -147,7 +147,7 @@ export function compilePattern(pattern: string): CompiledPattern {
if (pattern.includes('//')) throw new Error(`invalid route pattern '${pattern}': repeated slash`);
const normalized = pattern.length > 1 && pattern.endsWith('/') ? pattern.slice(0, -1) : pattern;
const rawSegments = normalized.split('/').slice(1);
const rawSegments = normalized === '/' ? [] : normalized.split('/').slice(1);
const segments = compileSegments(pattern, rawSegments);
const compiled: CompiledPattern = {
source: pattern,