Skip to content
New issue

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

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

Already on GitHub? # to your account

Choice labels not showing in Swagger. #679

Closed
futilestudio opened this issue Mar 14, 2022 · 2 comments
Closed

Choice labels not showing in Swagger. #679

futilestudio opened this issue Mar 14, 2022 · 2 comments

Comments

@futilestudio
Copy link

Describe the bug

Labels of choices not showing in Swagger docs

  • IntegerField, CharField
  • TextChoices, IntegerChoices and also a plain list of tuples

To Reproduce
Not showing in Swagger auto docs

Expected behavior
It would make a big difference if we could also show labels of choices, not just their values. Is that possible?

@tfranzel
Copy link
Owner

tfranzel commented Mar 14, 2022

this is related to #337, #403 (and #105). I totally get that this is a missing feature!

The problem is that OpenAPI 3.0.3 does not really provide a way to specify labels. Only hacks via the description string are possible at the moment. Not sure if OpenAPI 3.1 addressed that issue, but I believe I remember that it didn't yet.

We waited to see if there was some movement there before hacking together a non-standardized description string.

@tfranzel
Copy link
Owner

closing in favor of #337. discussion continues there

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants