mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
fix: merge inner properties of allOf
This commit is contained in:
parent
2462639f76
commit
8926dd457c
|
@ -76,12 +76,16 @@ exports[`Components SchemaView discriminator should correctly render discriminat
|
|||
"options": "<<<filtered>>>",
|
||||
"pattern": undefined,
|
||||
"rawSchema": Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"parentRefs": Array [],
|
||||
"type": "string",
|
||||
},
|
||||
"readOnly": false,
|
||||
"schema": Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"parentRefs": Array [],
|
||||
"type": "string",
|
||||
},
|
||||
"title": "",
|
||||
|
|
|
@ -212,11 +212,18 @@ export class OpenAPIParser {
|
|||
}
|
||||
|
||||
if (subSchema.properties !== undefined) {
|
||||
// TODO: merge properties contents
|
||||
receiver.properties = {
|
||||
...(receiver.properties || {}),
|
||||
...subSchema.properties,
|
||||
};
|
||||
receiver.properties = receiver.properties || {};
|
||||
for (let prop in subSchema.properties) {
|
||||
if (!receiver.properties[prop]) {
|
||||
receiver.properties[prop] = subSchema.properties[prop];
|
||||
} else {
|
||||
// merge inner properties
|
||||
receiver.properties[prop] = this.mergeAllOf(
|
||||
{ allOf: [receiver.properties[prop], subSchema.properties[prop]] },
|
||||
$ref + '/properties/' + prop,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (subSchema.required !== undefined) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user