fix: allOf inside oneOf overwritten and not rendered

fixes #660
This commit is contained in:
Roman Hotsiy 2018-10-01 10:19:25 +03:00
parent 533733bc7f
commit fe3383d1a3
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -161,9 +161,10 @@ export class SchemaModel {
(variant, idx) =>
new SchemaModel(
parser,
// merge base schema into each of oneOf's subschemas
{
// merge base schema into each of oneOf's subschemas
...variant,
// variant may already have allOf so merge it to not get overwritten
...parser.mergeAllOf(variant, this.pointer + '/oneOf/' + idx),
allOf: [{ ...this.schema, oneOf: undefined, anyOf: undefined }],
} as OpenAPISchema,
this.pointer + '/oneOf/' + idx,