OpenAPI core module¶
- class kinto.core.openapi.AnyTypeConverter(dispatcher)¶
Convert type agnostic parameter to swagger.
- class kinto.core.openapi.OpenAPI(services: Any, request: Request)¶
OpenAPI documentation generator.
- custom_type_converters = {<class 'kinto.core.schema.Any'>: <class 'kinto.core.openapi.AnyTypeConverter'>}¶
Kinto additional type converters.
- security_definitions = {}¶
Kinto security definitions. May be used for setting other security methods.
- security_roles = {}¶
Kinto resource security roles. May be used for setting OAuth roles by plugins.
- classmethod expose_authentication_method(method_name: str, definition: dict) None¶
Allow security extensions to expose authentication methods on the OpenAPI documentation. The definition field should correspond to a valid OpenAPI security definition. Refer to the OpenAPI docs for more information.
Below are some examples for BasicAuth and OAuth2:
{ "type": "basic", "description" "My basicauth method." } { "type": "oauth2", "authorizationUrl": "https://oauth-stable.dev.lcip.org/v1", "flow": "implicit", "scopes": {"kinto": "Kinto user scope."} }
- generate() dict¶
Generate a Swagger 2.0 documentation. Keyword arguments may be used to provide additional information to build methods as such ignores.
- Parameters:
title – The name presented on the swagger document.
version – The version of the API presented on the swagger document.
base_path – The path that all requests to the API must refer to.
info – Swagger info field.
swagger – Extra fields that should be provided on the swagger documentation.
- Return type:
- Returns:
Full OpenAPI/Swagger compliant specification for the application.