-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Refactor openapi converter #581
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.
Overall this looks good. Really cleans up these methods.
name="body", | ||
required=False, | ||
description=None | ||
self, schema, *, location, name="body", required=False, description=None |
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'm torn about what to do with the name
parameter. It's only used when location=="body"
and it's default value is tied to that case - I presume to guarantee a valid parameter object if the user doesn't enter anything. Seems like it's adding a little extra confusion to this method but I'm not sure anything better can be done.
Thanks @Bangertm for taking the time to review this. I think I'm gonna merge this and open an issue about the location mapping. |
Also remove dead code: location can't be body in fields2parameters
0737f6b
to
eaceb0b
Compare
1. Rename 'default_in' (marshmallow-code/apispec#526) 2. Dict schema: convert it to object and handle special case 'body', since prior used method no longer exists (marshmallow-code/apispec#581)
* Compatibility with apispec 4 1. Rename 'default_in' (marshmallow-code/apispec#526) 2. Dict schema: convert it to object and handle special case 'body', since prior used method no longer exists (marshmallow-code/apispec#581) * Drop support for apispec < 4, Python < 3.6 Supporting different apispec version requires different logic for each of them. New apispec requires Python >= 3.6 * Remove unused imports * Update tox.ini * Update changelog * Drop Python 3.5 support apispec no longer supports 3.5 Co-authored-by: Steven Loria <sloria1@gmail.com>
* Compatibility with apispec 4 1. Rename 'default_in' (marshmallow-code/apispec#526) 2. Dict schema: convert it to object and handle special case 'body', since prior used method no longer exists (marshmallow-code/apispec#581) * Drop support for apispec < 4, Python < 3.6 Supporting different apispec version requires different logic for each of them. New apispec requires Python >= 3.6 * Remove unused imports * Update tox.ini * Update changelog * Drop Python 3.5 support apispec no longer supports 3.5 Co-authored-by: Steven Loria <sloria1@gmail.com>
Based on #526.
Implements refactor discussed in #500 and #526.
I did not address handling webargs field dicts (#500 (comment)). It can be done later anytime (perhaps easier once MA2 is dropped).
Once #526 is merged, I can rebase this for a clearer diff.