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

Order of plugins affects output #136

Closed
CausticYarn opened this issue Jul 11, 2017 · 3 comments

Comments

@CausticYarn
Copy link

commented Jul 11, 2017

The example shows:

# Create an APISpec
spec = APISpec(
    title='Swagger Petstore',
    version='1.0.0',
    plugins=[
        'apispec.ext.flask',
        'apispec.ext.marshmallow',
    ],
)

And the output is:

#         "responses": {
#           "200": {
#             "schema": {
#               "$ref": "#/definitions/Pet"
#             },
#             "description": "A pet to be returned"
#           }

However, if the order of the plugins to spec is (marshmallow, flask), then the output is:

#         "responses": {
#           "200": {
#             "schema": "PetSchema"
#             "description": "A pet to be returned"
#           }

Which doesn't resolve correctly in the Swagger doc. If the order is relevant by design, it should be documented.

@sloria

This comment has been minimized.

Copy link
Member

commented Aug 9, 2017

This looks to be a bug; order should not matter, at least not for the flask and marshmallow plugins. I would definitely review and merge a PR fixing this.

@yoichi

This comment has been minimized.

Copy link
Collaborator

commented Oct 10, 2017

Order dependency comes from the fact that operation resolve process is done inside path helpers.
It can be solved by separating them #152

We have to introduce incompatible change to extension mechanism to solve it. I'm not sure we should fix this issue or not. What do you think? @sloria

@sloria sloria closed this Oct 31, 2017

@sloria

This comment has been minimized.

Copy link
Member

commented Oct 31, 2017

This is fixed in 0.27.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.