Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of HTTP response header #205

Open
Yilong94 opened this issue Nov 11, 2020 · 2 comments
Open

Validation of HTTP response header #205

Yilong94 opened this issue Nov 11, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Yilong94
Copy link

OpenAPI version
3

Is your feature request related to a problem? Please describe.
Currently the jest-openapi library validates the status and body of HTTP responses which works great. However, it doesnt seem to be validating the header of HTTP response even though it is specified in OpenAPI documentation.

Describe the solution you'd like
Validation of HTTP response header

@Yilong94 Yilong94 added the enhancement New feature or request label Nov 11, 2020
@rwalle61
Copy link
Collaborator

rwalle61 commented Nov 11, 2020

Thanks @Yilong94, I agree this would be useful.

Could you provide examples of specific use cases that we should support, so that whoever implements this enhancement can make sure they cover the top priorities?

Please show us some response objects (or responses from request packages) that would be valid/invalid against some example OpenAPI response definitions. Please suggest what assertion error you'd find useful.

(Ideally, use our simple Recreation template to create a simple runnable example)

Thanks!

@hicksjacobp
Copy link

A simple example is that the Content-Type doesn't appear to be validated. I have a Content-Type in my spec that doesn't match what the actual response has. I would have expected the call to satisfyApiSpec fail when it still passed.

For example, if the spec has application/vnd.something+json, but the response has application/vnd.somethingelse+json, I would expect the assertion to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants