litestar
litestar copied to clipboard
Enhancement: Add `Scalar` API documentation
Summary
- https://scalar.com/swagger-editor
Basic Example
- Swagger
- ReDoc
- RapiDoc
- Stoplight Elements
- Scalar
Drawbacks and Impact
This will need to be refactored into a plugin once we do that for the rest of them.
Unresolved questions
No response
I've got refactoring of the openapi controller on my radar - would you be happy for this to wait until that is done?
@peterschutt welp i refreshed my page and you commented 😅 i am happy to decline my pr though or rebase when you are done
The way I envisage the new approach, is that the openapi UI frameworks that you want to use will be configurable via the openapi config object. For backward compatibility, the default value for that config option will have to be every UI framework that we have released on the current openapi controller. My preference would be to wait until that is done, and then we can write a "plugin".
I don't think these things will be actual litestar plugins, but just openapi frontend plugins. They'll have a render(openapi_config: OpenapiConfig, openapi_json: dict[str, Any]) -> bytes:
method and have to declare the path they are to be served under.. smth like that anyway.
Closed in #2906