-
-
Notifications
You must be signed in to change notification settings - Fork 549
Support description for each x-enumNames value #1789
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
Support description for each x-enumNames value #1789
Conversation
86450b6 to
ad2ade4
Compare
|
Can you rebase and add a test case that shows the change? |
ad2ade4 to
4fcde15
Compare
- Add test case for enum descriptions with Description attributes - Add backward compatibility tests for x-enum-names, x-enum-varnames, and x-enum-descriptions - Fix JSON string assertions to properly check for quoted values
|
Hi @lahma, |
lahma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I switched to verify testing for output to get clearer picture of the output. Thank you!
|
Is there a good reason why it's serialized to "x-enum-descriptions" and not "x-enumDescriptions" like in all other places (e.g. "x-enumNames")? |
|
I think I googled what is the preferred and most used way and it turned out to be this, might need verification. Maybe Yet Another Configuration Option for preferred name.. |
|
OpenAPI 3.0 and 2.0 do not have a way to define custom names/descriptions for enum values, but some tools provide |
|
Maybe a PR for configurable name would be the best, closed PR usually doesn't carry far. |
System.ComponentModel.Descriptionattribute for each enum value and includes it in the schema underx-enumDescriptions.x-enumNamesas well asx-enum-namesandx-enum-varnames.x-enumDescriptionsandx-enum-descriptions.Close #1156