python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.14k stars 333 forks source link

Swagger UI: deepLinking parameter support #518

Open BaturinM opened 1 year ago

BaturinM commented 1 year ago

Swagger UI has deepLinking parameter which allows to deeply link into tags and operations within a url. See https://swagger.io/docs/open-source-tools/swagger-ui/usage/deep-linking/

Add SWAGGER_DEEP_LINKING parameter to flask application and handle it here https://github.com/python-restx/flask-restx/blob/master/flask_restx/templates/swagger-ui.html#L54

peter-doggart commented 1 year ago

SwaggerUI is not currently configurable from within flask-restx but you can use the @api.documentation decorator to override the default behaviour easily to render your own custom templates and therefore set any options you like.

I wrote a bit more of a how-to here which might be of interest to you: https://github.com/python-restx/flask-restx/issues/430#issuecomment-1104052909

BaturinM commented 1 year ago

SwaggerUI is not currently configurable from within flask-restx but you can use the @api.documentation decorator to override the default behaviour easily to render your own custom templates and therefore set any options you like.

I wrote a bit more of a how-to here which might be of interest to you: #430 (comment)

Thanks for quick answer! I already did the same for my own project to resolve this issue. After that I thought it would be great to have built-in solution directly in flask-restx. I even gonna to create pull request to contribite this feature.