OpenAPI settings

These settings used to control exposing OpenAPI.json and SwaggerUI/ReDoc endpoints.

pydantic model horizon.backend.settings.server.openapi.OpenAPISettings

OpenAPI Settings.

OpenAPI.json is served at /openapi.json endpoint.

Examples

HORIZON__SERVER__OPENAPI__ENABLED=True
HORIZON__SERVER__OPENAPI__SWAGGER__ENABLED=True
HORIZON__SERVER__OPENAPI__REDOC__ENABLED=True
Fields:
field enabled: bool = True

Set to True to enable OpenAPI.json endpoint

field swagger: SwaggerSettings [Optional]

Swagger UI settings

field redoc: RedocSettings [Optional]

ReDoc UI settings

Application logo settings

field favicon: FaviconSettings [Optional]

Application favicon settings

pydantic model horizon.backend.settings.server.openapi.SwaggerSettings

Swagger UI settings.

SwaggerUI is served at /docs endpoint.

Examples

HORIZON__SERVER__OPENAPI__SWAGGER__ENABLED=True
HORIZON__SERVER__OPENAPI__SWAGGER__JS_URL=/static/swagger/swagger-ui-bundle.js
HORIZON__SERVER__OPENAPI__SWAGGER__CSS_URL=/static/swagger/swagger-ui.css
Fields:
field enabled: bool = True

Set to True to enable Swagger UI endpoint

field js_url: str = 'https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js'

URL for Swagger UI JS

field css_url: str = 'https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css'

URL for Swagger UI CSS

field extra_parameters: Dict[str, Any] [Optional]

Additional parameters to pass to Swagger UI. See FastAPI documentation.

pydantic model horizon.backend.settings.server.openapi.RedocSettings

ReDoc settings.

ReDOc is served at /redoc endpoint.

Examples

HORIZON__SERVER__OPENAPI__REDOC__ENABLED=True
HORIZON__SERVER__OPENAPI__REDOC__JS_URL=/static/redoc/redoc.standalone.js
Fields:
field enabled: bool = True

Set to True to enable Redoc UI endpoint

field js_url: str = 'https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js'

URL for Redoc UI JS, None to use default CDN URL

pydantic model horizon.backend.settings.server.openapi.LogoSettings

OpenAPI’s x-logo documentation settings.

See OpenAPI spec for more details.

Examples

HORIZON__SERVER__OPENAPI__LOGO__URL=/static/logo.svg
HORIZON__SERVER__OPENAPI__LOGO__BACKGROUND_COLOR=ffffff
HORIZON__SERVER__OPENAPI__LOGO__ALT_TEXT=Horizon logo
HORIZON__SERVER__OPENAPI__LOGO__HREF=http://mycompany.domain.com
Fields:
field url: str = '/static/logo.svg'

URL for application logo

field background_color: str = 'ffffff'

Background color in HEX RGB format, without # prefix

field alt_text: str | None = 'Horizon logo'

Alternative text for <img> tag

field href: AnyHttpUrl | None = 'https://github.com/MobileTeleSystems/horizon'

Clicking on logo will redirect to this URL

pydantic model horizon.backend.settings.server.openapi.FaviconSettings

Favicon documentation settings.

Examples

HORIZON__SERVER__OPENAPI__FAVICON__URL=/static/icon.svg
Fields:
field url: str = '/static/icon.svg'

URL for application favicon