mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-18 02:40:32 +03:00
fix: incorrect detected schema title for deeply inherited schemas
This commit is contained in:
parent
b0e660eca0
commit
7d7b4e3fb8
|
@ -187,6 +187,7 @@ export class OpenAPIParser {
|
||||||
...schema,
|
...schema,
|
||||||
allOf: undefined,
|
allOf: undefined,
|
||||||
parentRefs: [],
|
parentRefs: [],
|
||||||
|
title: schema.title || (isNamedDefinition($ref) ? JsonPointer.baseName($ref) : undefined),
|
||||||
};
|
};
|
||||||
|
|
||||||
// avoid mutating inner objects
|
// avoid mutating inner objects
|
||||||
|
@ -263,11 +264,6 @@ export class OpenAPIParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// name of definition or title on top level
|
|
||||||
if (schema.title === undefined && isNamedDefinition($ref)) {
|
|
||||||
receiver.title = JsonPointer.baseName($ref);
|
|
||||||
}
|
|
||||||
|
|
||||||
return receiver;
|
return receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ Object {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"title": undefined,
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"allOf": undefined,
|
"allOf": undefined,
|
||||||
|
@ -38,6 +39,7 @@ Object {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"title": undefined,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -59,6 +61,7 @@ Object {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"title": undefined,
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"allOf": undefined,
|
"allOf": undefined,
|
||||||
|
@ -76,6 +79,7 @@ Object {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"title": undefined,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user