mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-26 23:10:33 +03:00
fix: hoist and combine allOf subschema titles
This commit is contained in:
parent
60bc603e9b
commit
7ee9d7f4f3
|
@ -269,6 +269,7 @@ export class OpenAPIParser {
|
|||
schema: MergedOpenAPISchema;
|
||||
}>;
|
||||
|
||||
const subSchemaTitles: string[] = [];
|
||||
for (const { $ref: subSchemaRef, schema: subSchema } of allOfSchemas) {
|
||||
if (
|
||||
receiver.type !== subSchema.type &&
|
||||
|
@ -326,6 +327,14 @@ export class OpenAPIParser {
|
|||
// receiver.title = JsonPointer.baseName(subSchemaRef);
|
||||
}
|
||||
}
|
||||
|
||||
if (subSchema.title !== undefined) {
|
||||
subSchemaTitles.push(subSchema.title);
|
||||
}
|
||||
}
|
||||
|
||||
if (receiver.title === undefined && subSchemaTitles.length) {
|
||||
receiver.title = subSchemaTitles.join('+');
|
||||
}
|
||||
|
||||
return receiver;
|
||||
|
|
Loading…
Reference in New Issue
Block a user