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

Validate accordingly with content-type defined in spec #205

Merged
merged 4 commits into from
Apr 7, 2016

Conversation

rafaelcaricio
Copy link
Collaborator

Fixes #203

Connexion should validate the schema of responses that have content-type as JSON.

Changes proposed in this pull request:

  • Validate using json-schema only responses of operations that produces JSON.
  • Makes it possible for Connexion applications to return binary data in operations.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 99.243% when pulling f360295 on rafaelcaricio:verify-content-type into 5e7c946 on zalando:master.

@hjacobs
Copy link
Contributor

hjacobs commented Apr 4, 2016

🙈 decreasing code coverage..

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0006%) to 99.458% when pulling a2fc4a8 on rafaelcaricio:verify-content-type into 5e7c946 on zalando:master.

@rafaelcaricio
Copy link
Collaborator Author

Going up again ☝️

@@ -48,7 +49,9 @@ def validate_response(self, data, status_code, headers):
response_definition = self.operation.resolve_reference(response_definition)
# TODO handle default response definitions

if response_definition and response_definition.get("schema"):
if response_definition and "schema" in response_definition \
and (produces_json([self.mimetype]) or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using parenthesis here would look better than using line continuations ('').

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.46% when pulling d99152c on rafaelcaricio:verify-content-type into 5e7c946 on zalando:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 99.46% when pulling 5c4d12f on rafaelcaricio:verify-content-type into 5e7c946 on zalando:master.

@jmcs
Copy link
Contributor

jmcs commented Apr 6, 2016

👍

1 similar comment
@hjacobs
Copy link
Contributor

hjacobs commented Apr 6, 2016

👍

@jmcs jmcs merged commit 9391aa1 into spec-first:master Apr 7, 2016
@jmcs jmcs removed the in progress label Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants