mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 02:23:43 +03:00
fix: OpenAPI 3.1: Missing description when $ref used #1727
This commit is contained in:
parent
35f77878de
commit
fe6909ed80
|
@ -206,13 +206,6 @@ export class OpenAPIParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shalowDeref<T extends object>(obj: OpenAPIRef | T): T {
|
|
||||||
if (this.isRef(obj)) {
|
|
||||||
return this.byRef<T>(obj.$ref)!;
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge allOf constraints.
|
* Merge allOf constraints.
|
||||||
* @param schema schema with allOF
|
* @param schema schema with allOF
|
||||||
|
|
|
@ -40,7 +40,7 @@ export class MediaTypeModel {
|
||||||
this.examples = {
|
this.examples = {
|
||||||
default: new ExampleModel(
|
default: new ExampleModel(
|
||||||
parser,
|
parser,
|
||||||
{ value: parser.shalowDeref(info.example) },
|
{ value: parser.shallowDeref(info.example) },
|
||||||
name,
|
name,
|
||||||
info.encoding,
|
info.encoding,
|
||||||
),
|
),
|
||||||
|
|
|
@ -505,13 +505,13 @@ export function mergeParams(
|
||||||
): Array<Referenced<OpenAPIParameter>> {
|
): Array<Referenced<OpenAPIParameter>> {
|
||||||
const operationParamNames = {};
|
const operationParamNames = {};
|
||||||
operationParams.forEach(param => {
|
operationParams.forEach(param => {
|
||||||
param = parser.shalowDeref(param);
|
param = parser.shallowDeref(param);
|
||||||
operationParamNames[param.name + '_' + param.in] = true;
|
operationParamNames[param.name + '_' + param.in] = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// filter out path params overridden by operation ones with the same name
|
// filter out path params overridden by operation ones with the same name
|
||||||
pathParams = pathParams.filter(param => {
|
pathParams = pathParams.filter(param => {
|
||||||
param = parser.shalowDeref(param);
|
param = parser.shallowDeref(param);
|
||||||
return !operationParamNames[param.name + '_' + param.in];
|
return !operationParamNames[param.name + '_' + param.in];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user