diff --git a/packages/mock/src/faker/getters/combine.ts b/packages/mock/src/faker/getters/combine.ts index 7af7cbe0f..f22aca93d 100644 --- a/packages/mock/src/faker/getters/combine.ts +++ b/packages/mock/src/faker/getters/combine.ts @@ -116,6 +116,14 @@ export const combineSchemasMock = ({ currentValue = `${currentValue ? `${currentValue},` : ''}${itemResolvedValue.value}`; } + if ( + resolvedValue.type === undefined && + currentValue && + separator === 'allOf' + ) { + currentValue = `...${currentValue}`; + } + const isObjectBounds = !combine || (['oneOf', 'anyOf'].includes(combine.separator) && separator === 'allOf'); diff --git a/tests/specifications/all-of.yaml b/tests/specifications/all-of.yaml index ff726cda2..bf3fd4c82 100644 --- a/tests/specifications/all-of.yaml +++ b/tests/specifications/all-of.yaml @@ -27,6 +27,22 @@ paths: - type: object required: - color + /rested-ref-in-all-of-pets: + get: + operationId: getNestedRefInAllOfPets + tags: + - pets + description: |- + Nested ref in allOf pets. + responses: + '200': + description: User + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PetRef' + - $ref: '#/components/schemas/PetDetail' components: schemas: @@ -48,3 +64,5 @@ components: properties: tag: type: string + PetRef: + $ref: '#/components/schemas/Pet'