openapi¶
OpenAPI config
The Byte Bot API uses Scalar as the default OpenAPI documentation UI, with Swagger UI available as a fallback option.
Accessing the API Documentation¶
Scalar UI (Default): http://localhost:8000/api/scalar
Swagger UI (Fallback): http://localhost:8000/api/swagger
OpenAPI Schema: http://localhost:8000/api/openapi.json
Custom Theme¶
The Scalar UI uses a custom theme with Byte brand colors:
Primary:
#42b1a8(Byte Teal)Secondary:
#7bcebc(Byte Blue)Accent:
#abe6d2(Byte Light Blue)
The theme supports both light and dark modes with automatic detection.
Configuration¶
OpenAPI Config.
- byte_api.lib.openapi.config = OpenAPIConfig(title='Byte Bot', version='0.2.0', create_examples=False, random_seed=10, contact=Contact(name='Admin', url=None, email='hello@byte-bot.app'), description='The Byte Bot API supports the Byte Discord bot.\n You can find out more about this project in the\n [docs](https://docs.byte-bot.app/latest).', external_docs={'description': 'Byte Bot API Docs', 'url': 'https://docs.byte-bot.app/latest'}, license=None, security=None, components=Components(schemas={}, responses=None, parameters=None, examples=None, request_bodies=None, headers=None, security_schemes=None, links=None, callbacks=None, path_items=None), servers=[Server(url='http://0.0.0.0:8000', description='Development', variables=None), Server(url='https://dev.byte-bot.app/', description='Test', variables=None), Server(url='https://byte-bot.app/', description='Production', variables=None)], summary=None, tags=None, terms_of_service=None, use_handler_docstrings=True, webhooks=None, operation_id_creator=<function default_operation_id_creator>, path='/api', render_plugins=[<litestar.openapi.plugins.ScalarRenderPlugin object>, <litestar.openapi.plugins.SwaggerRenderPlugin object>], openapi_router=None, openapi_controller=None, root_schema_site='redoc', enabled_endpoints={'redoc', 'rapidoc', 'openapi.json', 'openapi.yml', 'elements', 'swagger', 'openapi.yaml', 'oauth2-redirect.html'})¶
OpenAPI config for the project. See
OpenAPISettingsfor configuration.