PWZER / swagger-ui-py

Swagger UI for Python web framework, such Tornado, Flask and Sanic. https://pwzer.github.io/swagger-ui-py/
https://pypi.org/project/swagger-ui-py
Apache License 2.0
68 stars 31 forks source link

flask blueprint naming clash #31

Open elmanm opened 2 years ago

elmanm commented 2 years ago

I haven't tested this with other handler integrations but in the flask integration, because the Blueprint is created with a hardcoded name "swagger_blueprint", you can't add ui more than once (e.g. if you have have multiple specifications for different versions), because each Blueprint must have a unique name.

It would be nice if the name was derived from the ApplicationDocument.title or ApplicationDocument.url_prefix, so it can be set per document if needed.

PWZER commented 2 years ago

There could be a problem,thank you for your advice.