diff --git a/lib/util/resolve-local-ref.js b/lib/util/resolve-local-ref.js index ca6aea80..edf406db 100644 --- a/lib/util/resolve-local-ref.js +++ b/lib/util/resolve-local-ref.js @@ -24,10 +24,7 @@ function resolveLocalRef (jsonSchema, externalSchemas) { // for oneOf, anyOf, allOf support in querystring/params/headers if (jsonSchema.oneOf || jsonSchema.anyOf || jsonSchema.allOf) { const schemas = jsonSchema.oneOf || jsonSchema.anyOf || jsonSchema.allOf - return schemas.reduce(function (acc, schema) { - const json = resolveLocalRef(schema, externalSchemas) - return { ...acc, ...json } - }, {}) + return schemas.reduce((acc, schema) => Object.assign(acc, resolveLocalRef(schema, externalSchemas)), {}) } // $ref is in the format: #/definitions//