Incompatibility with apispec 4.0.0 -> schema2parameters() now needs an argument "location"
Houkime opened this issue · 4 comments
The change was introduced in marshmallow-code/apispec@ee8002b
And apispec
4.0.0 went live on september 30 with this included.
The new signature is like here (openapi.py, comments included so that constraints are clearer):
def schema2parameters(
self, schema, *, location, name="body", required=False, description=None
):
"""Return an array of OpenAPI parameters given a given marshmallow
:class:`Schema <marshmallow.Schema>`. If `location` is "body", then return an array
of a single parameter; else return an array of a parameter for each included field in
the :class:`Schema <marshmallow.Schema>`.
In OpenAPI 3, only "query", "header", "path" or "cookie" are allowed for the location
of parameters. "requestBody" is used when fields are in the body.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject
"""
(take note that "body" is not allowed in OpenAPI 3)
Ok, so my exact problem with this (mentioned right above) was occuring on Arch Linux.
requirements.txt
does actually forbid apispec from crossing 4.0.0 but the Arch package
https://www.archlinux.org/packages/community/any/python-aiohttp-apispec/
does not account for that and allows to use apispec 4.0.0.
So, currently aiohttp_apispec is broken on Arch if installed from pacman and works if installed from pip.
Notified maintainer.
cc @felixonmars
Opened Arch bug report at https://bugs.archlinux.org/task/68874
Closed with #115