File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ # 1.3.6 - 3 Sep 2025
2+ Improvement:
3+ - type generator: add loose path type matching
4+
15# 1.3.5 - 3 Sep 2025
26Bug fix:
37- type generator: merge references with existing response status
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ const isValidSchema = (schema: any): schema is TSchema =>
6060 schema . properties ||
6161 schema . items )
6262
63+ export const getLoosePath = ( path : string ) => {
64+ if ( path . charCodeAt ( path . length - 1 ) === 47 )
65+ return path . slice ( 0 , path . length - 1 )
66+
67+ return path + '/'
68+ }
69+
6370/**
6471 * Converts Elysia routes to OpenAPI 3.0.3 paths schema
6572 * @param routes Array of Elysia route objects
@@ -115,7 +122,10 @@ export function toOpenAPISchema(
115122
116123 if ( references )
117124 for ( const reference of references as AdditionalReference [ ] ) {
118- const refer = reference [ route . path ] ?. [ method ]
125+ const refer =
126+ reference [ route . path ] ?. [ method ] ??
127+ reference [ getLoosePath ( route . path ) ] ?. [ method ]
128+
119129 if ( ! refer ) continue
120130
121131 if ( ! hooks . body && isValidSchema ( refer . body ) )
You can’t perform that action at this time.
0 commit comments