File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ export const mapProperties = (
5151 } )
5252}
5353
54+ const makeRefString = ( $ref : string ) => ! $ref . startsWith ( '#/components/schemas/' )
55+ ? `#/components/schemas/${ $ref } `
56+ : $ref
57+
5458const mapTypesResponse = (
5559 types : string [ ] ,
5660 schema :
@@ -81,26 +85,14 @@ const mapTypesResponse = (
8185 schema [ Kind ] === 'Ref'
8286 ? {
8387 ...schema ,
84- $ref : `#/components/schemas/ ${ schema . $ref } `
88+ $ref : makeRefString ( schema . $ref )
8589 }
8690 : replaceSchemaType (
8791 { ...( schema as any ) } ,
8892 {
8993 from : t . Ref ( '' ) ,
9094 // @ts -expect-error
91- to : ( { $ref, ...options } ) => {
92- if (
93- ! $ref . startsWith (
94- '#/components/schemas/'
95- )
96- )
97- return t . Ref (
98- `#/components/schemas/${ $ref } ` ,
99- options
100- )
101-
102- return t . Ref ( $ref , options )
103- }
95+ to : ( { $ref, ...options } ) => t . Ref ( makeRefString ( $ref ) , options ) ,
10496 }
10597 )
10698 }
You can’t perform that action at this time.
0 commit comments