Fix nested allOfs

This commit is contained in:
Roman Hotsiy 2017-11-23 15:27:50 +02:00
parent c1fe2e6899
commit 1994002685
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -166,9 +166,11 @@ export class OpenAPIParser {
};
const allOfSchemas = schema.allOf.map((subSchema, idx) => {
const resolved = this.deref(subSchema, forceCircular);
const subRef = subSchema.$ref || $ref + '/allOf/' + idx;
return {
$ref: subSchema.$ref || $ref + '/allOf/' + idx,
schema: this.deref(subSchema, forceCircular),
$ref: subRef,
schema: this.mergeAllOf(resolved, subRef, forceCircular),
};
});