litestar-org / litestar

Production-ready, Light, Flexible and Extensible ASGI API framework | Effortlessly Build Performant APIs
https://litestar.dev/
MIT License
5.42k stars 371 forks source link

Enhancement: Add `Scalar` API documentation #2846

Closed JacobCoffee closed 2 months ago

JacobCoffee commented 10 months ago

Summary

Basic Example

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

peterschutt commented 10 months ago

I've got refactoring of the openapi controller on my radar - would you be happy for this to wait until that is done?

JacobCoffee commented 10 months ago

@peterschutt welp i refreshed my page and you commented 😅 i am happy to decline my pr though or rebase when you are done

peterschutt commented 10 months ago

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.

Alc-Alc commented 2 months ago

Closed in #2906