-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Related to piccolo-orm/piccolo#1086
The UI of Piccolo Admin is largely driven by OpenAPI schemas (generated via create_pydantic_model
in Piccolo).
We augment the OpenAPI schemas with Piccolo specific metadata (under the extra
attribute).
Pydantic allows us to do this, and it has worked pretty well up until now. But other libraries (Litestar) complain if an OpenAPI schema has any custom attributes.
It should be possible to add custom attributes, as long as they start with x-
, but we can't work out how to do it and still keep Litestar happy.
Which just leaves us with these options:
- Completely replace the current schema endpoint with our own custom one.
- Keep the current /schema endpoint in Piccolo Admin (minus all of the custom attributes), and have a second endpoint (something like /meta) which contains all of the custom attributes. The downside is it means 2 API calls instead of 1.
- Have our own custom endpoint, but embed the existing schema JSON within it. Something like {"schema": ..., "custom": ...}.
Metadata
Metadata
Assignees
Labels
No labels