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
Ignore "location" field metadata #526
Conversation
Should also consider making the ‘in’ parameter required. Now that fields do not contain location apispec always has to know what to put in that parameter and defaulting to ‘body’ doesn’t make much sense. |
d9fd5f8
to
6b25286
Compare
Removal of potential dead code (see #500) can be done in another PR. But ideally before 4.0 if we decide to make some methods private. |
Just looking at this again. Once all the unneeded code is removed from [
self.field2parameter(
field_obj,
name=self._observed_name(field_obj, field_name),
location=location,
) for field_name, field_obj in fields.item()
] The conditional Given this, instead of making the method private we could just remove it altogether and just do the list comprehension in |
6b25286
to
a22bb4e
Compare
The refactor is done in #581. I think this is ready to merge. |
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>
Same rationale as marshmallow-code/webargs#420. Ignore "location" in field metadata.
TODO:
default_in
aslocation
orin
. It is not a default anymore.Remove dead code as per explode and style are hardcoded in OpenAPIConverter.property2parameter #500.Addressed in Refactor openapi converter #581.