mirror of
https://github.com/Redocly/redoc.git
synced 2024-12-01 21:03:45 +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>>>",
|
"options": "<<<filtered>>>",
|
||||||
"pattern": undefined,
|
"pattern": undefined,
|
||||||
"rawSchema": Object {
|
"rawSchema": Object {
|
||||||
|
"allOf": undefined,
|
||||||
"default": undefined,
|
"default": undefined,
|
||||||
|
"parentRefs": Array [],
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
"readOnly": false,
|
"readOnly": false,
|
||||||
"schema": Object {
|
"schema": Object {
|
||||||
|
"allOf": undefined,
|
||||||
"default": undefined,
|
"default": undefined,
|
||||||
|
"parentRefs": Array [],
|
||||||
"type": "string",
|
"type": "string",
|
||||||
},
|
},
|
||||||
"title": "",
|
"title": "",
|
||||||
|
|
|
@ -212,11 +212,18 @@ export class OpenAPIParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subSchema.properties !== undefined) {
|
if (subSchema.properties !== undefined) {
|
||||||
// TODO: merge properties contents
|
receiver.properties = receiver.properties || {};
|
||||||
receiver.properties = {
|
for (let prop in subSchema.properties) {
|
||||||
...(receiver.properties || {}),
|
if (!receiver.properties[prop]) {
|
||||||
...subSchema.properties,
|
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) {
|
if (subSchema.required !== undefined) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user