mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
fix: move title propagation to the correct place
This commit is contained in:
parent
9d0f2a9273
commit
0b0bc99f73
|
@ -191,10 +191,6 @@ export class OpenAPIParser {
|
|||
};
|
||||
});
|
||||
|
||||
if (receiver.title === undefined && isNamedDefinition($ref)) {
|
||||
receiver.title = JsonPointer.baseName($ref);
|
||||
}
|
||||
|
||||
for (let { $ref: subSchemaRef, schema: subSchema } of allOfSchemas) {
|
||||
if (
|
||||
receiver.type !== subSchema.type &&
|
||||
|
@ -220,17 +216,22 @@ export class OpenAPIParser {
|
|||
receiver.required = (receiver.required || []).concat(subSchema.required);
|
||||
}
|
||||
|
||||
// merge rest of constraints
|
||||
// TODO: do more intelegent merge
|
||||
receiver = { ...subSchema, ...receiver };
|
||||
|
||||
if (subSchemaRef) {
|
||||
receiver.parentRefs!.push(subSchemaRef);
|
||||
if (receiver.title === undefined && isNamedDefinition(subSchemaRef)) {
|
||||
receiver.title = JsonPointer.baseName(subSchemaRef);
|
||||
}
|
||||
}
|
||||
|
||||
// merge rest of constraints
|
||||
// TODO: do more intelegent merge
|
||||
receiver = { ...subSchema, ...receiver };
|
||||
}
|
||||
|
||||
if (receiver.title === undefined && isNamedDefinition($ref)) {
|
||||
receiver.title = JsonPointer.baseName($ref);
|
||||
}
|
||||
|
||||
return receiver;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user