File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ class SchemaHandler {
1515 serverless . service ?. provider ?. apiGateway ?. request ?. schemas || { } ;
1616 this . documentation = serverless . service . custom . documentation ;
1717 this . openAPI = openAPI ;
18+
1819 this . shouldConvert = true ;
19- if ( / ( 3 \. 1 \. \d ) / g( this . openAPI . openapi ) ) this . shouldConvert = false ;
20+ if ( / ( 3 \. 1 \. \d ) / g. test ( this . openAPI . openapi ) ) this . shouldConvert = false ;
2021
2122 this . modelReferences = { } ;
2223
@@ -159,11 +160,11 @@ class SchemaHandler {
159160 }
160161 ) ;
161162
162- this . logger . verbose (
163- `dereferenced model: ${ JSON . stringify ( dereferencedSchema ) } `
164- ) ;
165-
166163 if ( this . shouldConvert ) {
164+ this . logger . verbose (
165+ `dereferenced model: ${ JSON . stringify ( dereferencedSchema ) } `
166+ ) ;
167+
167168 this . logger . verbose ( `converting model: ${ name } ` ) ;
168169 const convertedSchemas = SchemaConvertor . convert (
169170 dereferencedSchema ,
@@ -176,7 +177,13 @@ class SchemaHandler {
176177 return convertedSchemas ;
177178 }
178179
179- return dereferencedSchema ;
180+ this . logger . verbose (
181+ `dereferenced model: ${ JSON . stringify ( {
182+ schemas : { [ name ] : dereferencedSchema } ,
183+ } ) } `
184+ ) ;
185+
186+ return { schemas : { [ name ] : dereferencedSchema } } ;
180187 }
181188
182189 async __dereferenceSchema ( schema ) {
You can’t perform that action at this time.
0 commit comments