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

content_type_conformance check not working for openapi 3 #461

Closed
jeremyschiemann opened this issue Apr 3, 2020 · 3 comments · Fixed by #465
Closed

content_type_conformance check not working for openapi 3 #461

jeremyschiemann opened this issue Apr 3, 2020 · 3 comments · Fixed by #465
Assignees
Labels
Priority: High Important but not urgent Type: Bug Errors or unexpected behavior

Comments

@jeremyschiemann
Copy link
Contributor

Hi,
the check content_type_conformance (in checks.py) is looking for the produces property, which is openapi 2. In openapi 3 however this has moved to the individual response codes.

This should be easily fixable by reading the response code and then adjust the json path in said check.

I also discovered that schemathesis (unintentionally) ignores the media types in it's requests for openapi 3. Which is probably the same problem.

schemathesis 1.0.2

@Stranger6667
Copy link
Member

Hi @jeremyschiemann,
Oh, it is a nice discovery, I'll check & fix both cases, thank you :)

@Stranger6667 Stranger6667 self-assigned this Apr 3, 2020
@Stranger6667 Stranger6667 added Priority: High Important but not urgent Type: Bug Errors or unexpected behavior labels Apr 3, 2020
@Stranger6667
Copy link
Member

Also, the current check implementation for OAS2 gives precedence to the global produces, however, operation-level produces should override the global one. I'll fix it too

@Stranger6667
Copy link
Member

The fix is released in 1.0.3
https://pypi.org/project/schemathesis/1.0.3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Important but not urgent Type: Bug Errors or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants