feat: support enum names and descriptions #6948
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added support for
x-enum-varnames
/x-enumNames
andx-enum-descriptions
.Motivation and Context
x-enumNames
are supported by NSwag (docs).Also
x-enum-varnames
/x-enum-descriptions
are supported by openapi-generator (docs).These values can be used for providing names or descriptions for each enum values.
It would be great if it is shown also with Swagger UI.
Refs #5272 (This PR does not change dropdowns so it will not fix this issue)
How Has This Been Tested?
Ran
npm run dev
and checked the behavior with the urls below.https://petstore.swagger.io/v2/swagger.json
: without anyx-enumNames
orx-enum-varnames
orx-enum-descriptions
https://raw.githubusercontent.com/traPtitech/traQ/master/docs/v3-api.yaml
: withx-enum-varnames
andx-enum-descriptions
Screenshots (if appropriate):
Without any
x-enumNames
orx-enum-varnames
orx-enum-descriptions
With
x-enum-varnames
andx-enum-descriptions
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
I am not sure whether this should be documented.
Automated tests
I am not sure whether this change is needed to be tested.