OpenApiConfigurator
- class OpenApiConfigurator(app: Application)
Configures an OpenAPI endpoint for the specified
tornado.web.Application.- commit(host: str | list[str] = '.*') OpenApiConfiguration
Finalizes the configuration and configures Tornado to handle relevant requests.
- pattern(pattern: str) OpenApiConfigurator
OPTIONAL. Sets the pattern for request matching. Default is
r'/(swagger.*)'.
- staticFilesPath(path: str) OpenApiConfigurator
OPTIONAL. Sets the path (relative or absolute) where
swagger-uistatic files can be found. Default is"./swagger-ui".
- info(info: Info) OpenApiConfigurator
REQUIRED. Sets the Info Object for the endpoint.
- filter(predicate: Callable[[str], bool]) OpenApiConfigurator
OPTIONAL. Sets a filter allowing you to control which ‘tags’ or ‘api groups’ are included in the resulting OAS.
By default, all tags are included. The assumption is that a given server will only have one OAS document which describes all available APIs.
- apiKey(description: str = None, name: str = 'X-API-Key', location: ParameterLocation = ParameterLocation.HEADER) OpenApiConfigurator
OPTIONAL. Indicates that API KEY Authentication is supported.
- Parameters:
name (str) – The name of the header, query or cookie parameter containing the API KEY. Default is
'X-API-Key'description (str) – A useful description of the API KEY authentication.
location (ParameterLocation) – The location of the API KEY. Default is
HEADER.
- httpBasic(description: str = None) OpenApiConfigurator
OPTIONAL. Indicates that HTTP BASIC Authentication is supported.
- Parameters:
description (str) – A useful description of the HTTP BASIC authentication.
- bearerToken(description: str = None, bearerFormat: str = 'JWT') OpenApiConfigurator
OPTIONAL. Indicates that BEARER TOKEN Authentication is supported.
- Parameters:
description (str) – A useful description of the BEARER TOKEN authentication.
bearerFormat (str) – A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
- mutualTLS(description: str = None) OpenApiConfigurator
OPTIONAL. Indicates that MUTUAL TLS Authentication is supported.
- Parameters:
description (str) – A useful description of the MUTUAL TLS authentication.
- oauth2(flows: OAuthFlows, description: str = None) OpenApiConfigurator
OPTIONAL. Indicates that OAUTH2 Authentication is supported.
- Parameters:
flows (OAuthFlows) – The OAuth flows that are allowed.
description (str) – A useful description of the OAUTH2 authentication.
- openId(openIdConnectUrl: str, description: str = None) OpenApiConfigurator
OPTIONAL. Indicates that OPENID Authentication is supported.
- Parameters:
openIdConnectUrl (str) – Well-known URL to discover the OpenID-Connect-Discovery provider metadata..
description (str) – A useful description of the OPENID authentication.