Fix api schema enums #2438
Labels
api
This is affecting the api
is: bug
status: pinned
This issue or pull request won't stale
upstream
This is related to an upstream issue
Describe the bug
Some choices in the API are of the same shape and name, but are name spaced inside there respective Models.
When generating the API schema, this results in a merger of the multiple Choices, and the last one take precedence overs the previous ones.
Since drf-spectacular >=0.26 #2423, the schema enums have a description, which makes the api schema documentation about those choices wrong. It attaches the wrong enum name and description to some unrelated models.
This will be fixed in a future release of spectacular and might require django 5.0, so the it might only be ready in some "far future".
See tfranzel/drf-spectacular#790
To reproduce
See https://github.com/libretime/libretime/pull/2423/files
Expected behavior
Each Choices should have its own name and description. The schema enum overrides setting should also prevent from merging enums of same shape.
Relevant log output or error messages
No response
LibreTime version
89372ae
Installation method and OS / Environment
Irrelevant
Installation details
No response
Client Environment
No response
Screenshots
No response
The text was updated successfully, but these errors were encountered: