Which package are you using?
chai-openapi-response-validator
OpenAPI version
3
Describe the bug
Support "default" and "5XX" types of response status code. Those responses are valid based on the open api documents.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responsesObject
https://swagger.io/docs/specification/describing-responses/
OpenAPIValidators doesn't seem to support these responses other than status codes in number.
To Reproduce
Sorry for not having time to provide recreation test case.
-
In open api spec, add 2 different types of response type, "200" and "default", under responses section for whatever path and method
-
In a test, call satisfyApiSpec with actual response with 400 status code
-
Test fails with
expected res to satisfy a '400' response defined for endpoint 'GET /aaa/bbb' in your API spec
res had status '400', but your API spec has no '400' response defined for endpoint 'GET /aaa/bbb'
Response statuses found for endpoint 'GET /subject/{subjectCode}/{apiVersion}/textbooks' in API spec: 200, default`
Expected behavior
The response is supposed to be validated based on the "default" response definition under responses
Additional context
Reproduce steps above are only about default. But I can see that OpenAPIValidators doesn't support status code range such as "5XX" either
Are you going to resolve the issue?
I'd like you to confirm this is a bug or there's something I'm missing.
Which package are you using?
chai-openapi-response-validatorOpenAPI version
3
Describe the bug
Support "default" and "5XX" types of response status code. Those responses are valid based on the open api documents.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responsesObject
https://swagger.io/docs/specification/describing-responses/
OpenAPIValidators doesn't seem to support these responses other than status codes in number.
To Reproduce
Sorry for not having time to provide recreation test case.
In open api spec, add 2 different types of response type, "200" and "default", under
responsessection for whatever path and methodIn a test, call
satisfyApiSpecwith actual response with 400 status codeTest fails with
Expected behavior
The response is supposed to be validated based on the "default" response definition under
responsesAdditional context
Reproduce steps above are only about
default. But I can see that OpenAPIValidators doesn't support status code range such as "5XX" eitherAre you going to resolve the issue?
I'd like you to confirm this is a bug or there's something I'm missing.