-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
Converting response to raise a ProblemException #955
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment on why you're getting the aiohttp error in tests.
The following errors are not related to aiohttp, and I don't know why your change is triggering them.
Apparently the default object in the spec is not replacing the None
body.
test_default_object_body[swagger.yaml]
test_default_object_body[openapi.yaml]
Side note: In reviewing some of the errors "test_default_object_body", I plan on removing those tests. While I have no idea how it was passing before, reviewing json-schema/json-schema#5 seems to suggest that default should NOT be applied when something is required. Below is the exception I am seeing for this case:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see this merged so that core connexion raises ProblemException
everywhere instead of returning a problem response. That feels much cleaner and more consistent.
I have a few comments about how this might move the PR forward.
Any update on this PR and possibility of merging @cognifloyd? Thanks! |
I do not work for Zalando, so I can't merge any PRs here. To that end, this PR has a merge conflict since #952 was merged. I would recommend rebasing. |
Any movement on this, I'd love to see it merged? |
Could you rebase the PR and fix the conflicts? We will take a look afterwards. |
# Conflicts: # tests/test_validation.py
@ConstantinoSchillebeeckxSimpleRose and @hjacobs Sorry for the MIA-ness. I have updated the PR with the changes. Let me know what you think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's the note I left about deprecating ProblemException.to_problem, and a couple of questions about tests changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
👍 |
The goal of this to convert all possible error responses to be a raised ProblemException subclass instead. Also for flask, allow for the option to skip the error handling.
The goal is to allow the end application handle the exceptions, as well as customize the response that aligns with the application's payload structure.