跳转至

配置

Flask supports many configurations, and there are also some configurations in this library that can be used.

SWAGGER_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default SWAGGER_HTML_STRING is here.

SWAGGER_CONFIG⚓︎

You can change the default behavior of the Swagger UI.

1
2
3
4
5
6
7
8
from flask_openapi3 import OpenAPI

app = OpenAPI(__name__)

app.config["SWAGGER_CONFIG"] = {
    "docExpansion": "none",
    "validatorUrl": "https://www.b.com"
}

More configuration options for Swagger UI.

OAUTH_CONFIG⚓︎

You can configure OAuth 2.0 authorization for Swagger UI.

1
2
3
4
5
from flask_openapi3 import OpenAPI

app = OpenAPI(__name__)

app.config["OAUTH_CONFIG"] = {"clientId": "xxx", "clientSecret": "xxx"}

More configuration options for Swagger UI.

SCALAR_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default SCALAR_HTML_STRING is here.

SCALAR_CONFIG⚓︎

You can change the default behavior of the Scalar UI.

More configuration options for Swagger UI.

REDOC_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default REDOC_HTML_STRING is here.

REDOC_CONFIG⚓︎

You can change the default behavior of the Redoc UI.

More configuration options for Redoc UI.

RAPIDOC_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default RAPIDOC_HTML_STRING is here.

RAPIDOC_CONFIG⚓︎

You can change the default behavior of the Rapidoc UI.

More configuration options for Rapidoc UI.

RAPIPDF_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default RAPIPDF_HTML_STRING is here.

RAPIPDF_CONFIG⚓︎

You can change the default behavior of the Rapipdf UI.

More configuration options for Rapipdf UI.

ELEMENTS_HTML_STRING⚓︎

You can customize the custom behavior of this template.

The default ELEMENTS_HTML_STRING is here.

ELEMENTS_CONFIG⚓︎

You can change the default behavior of the Elements UI.

More configuration options for Rapipdf UI.