litestar icon indicating copy to clipboard operation
litestar copied to clipboard

Enhancement: Add `Scalar` API documentation

Open JacobCoffee opened this issue 1 year ago • 3 comments

Summary

  • https://scalar.com/swagger-editor image

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

JacobCoffee avatar Dec 06 '23 00:12 JacobCoffee

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

peterschutt avatar Dec 06 '23 02:12 peterschutt

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

JacobCoffee avatar Dec 06 '23 04:12 JacobCoffee

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.

peterschutt avatar Dec 06 '23 04:12 peterschutt

Closed in #2906

Alc-Alc avatar Aug 01 '24 12:08 Alc-Alc