-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Are you using jest or chai?
jest
Are you using OpenAPI 2, 3.0.X, or 3.1.0?
3.0.0
Describe the bug clearly
I have a response type defined in openAPI yaml file that is combined with 2 response types using allOf, like the following:
GetXResponse:
allOf:
- $ref: '#/components/schemas/YResponse'
- type: object
title: GetXResponse
additionalProperties: false
properties:
data:
type: array
items:
$ref: '#/components/schemas/X'
required:
- data
When using jest-openapi toSatisfyApiSpec method, it throws an error:
expected received to satisfy the '200' response defined for endpoint 'GET /x' in your API spec
received did not satisfy it because: response must NOT have additional properties
Even though I see that the printed output really corresponds to GetXResponse.
Steps to reproduce the bug:
- Use schema defined above for tested route
- Create a test for that request that includes expect(response).toSatisfyApiSpec();
- See error:
expected received to satisfy the '200' response defined for endpoint 'GET /x' in your API spec
received did not satisfy it because: response must NOT have additional properties
What did you expect to happen instead?
API spec will acknowledge the extending of GetXResponse
Are you going to resolve the issue?
dont know how