sanic-org / sanic-openapi

Easily document your Sanic API with a UI
https://sanic-openapi.readthedocs.io/
MIT License
505 stars 108 forks source link

[Feature Request] Allow default endpoint in OpenAPI V3 Blueprints to be configurable #256

Closed CormacMOB closed 2 years ago

CormacMOB commented 2 years ago

We use /docs instead of /swagger as the endpoint for our swagger documentation sites. We feel that "docs" being short for "documentation" is more representative of what we are routing to than "swagger" being walking all cool and stuff. We find that we need to then reroute traffic from /docs to/swagger` in the application startup logic.

I would like a means to override the string passed to the url_prefix keyword argument of the openapi Blueprint at insatntiation time. E.g. By adding a value to the SWAGGER_UI_CONFIGURATION which would be read when the blueprint_factory is called.

oas3_blueprint = Blueprint("openapi", url_prefix=config.swagger_url_prefix)

CormacMOB commented 2 years ago

I was mistaken.