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

Route parameter openapi generation is incompatible with 3.0 #25

Closed
zedrdave opened this issue Nov 18, 2018 · 3 comments
Closed

Route parameter openapi generation is incompatible with 3.0 #25

zedrdave opened this issue Nov 18, 2018 · 3 comments

Comments

@zedrdave
Copy link

When using a parameter in a route: @bp.route('/<string:foo_id>')

The openapi.json generated is not compatible with openapi 3.0:

"parameters": [
          {
            "in": "path",
            "name": "foo_id",
            "required": true,
            "type": "string"
          }
        ]

should be:

"parameters": [
          {
            "in": "path",
            "name": "bar_id",
            "required": true,
            "schema": {
                 "type": "string"
            }
          }
        ]

I am not sure if this is a flask-rest-api issue, or something to fix in a dependency… But I would be happy to take stab at a PR, if pointed in the right direction (I couldn't figure where in blueprint.py that part of the doc was generated).

@lafrech
Copy link
Member

lafrech commented Nov 18, 2018

Hi. Thanks for reporting. I pushed the fix for this 2 hours ago: 655e3f0.

Would you like to try that before I release?

@zedrdave
Copy link
Author

Ha. What a coincidence! Sorry I wasn't around yesterday: I'll be happy to try it from github now, or confirm it works from the release.

@lafrech
Copy link
Member

lafrech commented Nov 20, 2018

Fix released !

@lafrech lafrech closed this as completed Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants