Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix api schema enums #2438

Open
jooola opened this issue Mar 14, 2023 · 1 comment
Open

Fix api schema enums #2438

jooola opened this issue Mar 14, 2023 · 1 comment
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

Comments

@jooola
Copy link
Contributor

jooola commented Mar 14, 2023

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

@jooola jooola added is: bug api This is affecting the api upstream This is related to an upstream issue labels Mar 14, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 5 months. It will be closed if no activity occurs in the next month.
Please chat to us on the forum or ask for help on #libretime:matrix.org if you have any questions or need further support with getting this issue resolved.
You may also label an issue as pinned if you would like to make sure that it does not get closed by this bot.

@github-actions github-actions bot added the status: stalled This issue or pull request is stalled label Aug 12, 2023
@paddatrapper paddatrapper added status: pinned This issue or pull request won't stale and removed status: stalled This issue or pull request is stalled labels Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants