diff --git a/src/services/OpenAPIParser.ts b/src/services/OpenAPIParser.ts index 1683e927..399ce1d5 100644 --- a/src/services/OpenAPIParser.ts +++ b/src/services/OpenAPIParser.ts @@ -206,13 +206,6 @@ export class OpenAPIParser { } } - shalowDeref(obj: OpenAPIRef | T): T { - if (this.isRef(obj)) { - return this.byRef(obj.$ref)!; - } - return obj; - } - /** * Merge allOf constraints. * @param schema schema with allOF diff --git a/src/services/models/MediaType.ts b/src/services/models/MediaType.ts index 9e41d89a..25dae807 100644 --- a/src/services/models/MediaType.ts +++ b/src/services/models/MediaType.ts @@ -40,7 +40,7 @@ export class MediaTypeModel { this.examples = { default: new ExampleModel( parser, - { value: parser.shalowDeref(info.example) }, + { value: parser.shallowDeref(info.example) }, name, info.encoding, ), diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index ad267722..d0b081f5 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -505,13 +505,13 @@ export function mergeParams( ): Array> { const operationParamNames = {}; operationParams.forEach(param => { - param = parser.shalowDeref(param); + param = parser.shallowDeref(param); operationParamNames[param.name + '_' + param.in] = true; }); // filter out path params overridden by operation ones with the same name pathParams = pathParams.filter(param => { - param = parser.shalowDeref(param); + param = parser.shallowDeref(param); return !operationParamNames[param.name + '_' + param.in]; });