Open MattStaffordGS opened 7 years ago
Any update on this?
It would be great if ReDoc could take x-enumNames
into account if it is available. It is generated by the NSwag swagger toolchain and defines the enum names (not the values) and is useful for number enums (i.e. when the human readable names are missing).
Swagger/OpenAPI definition:
"PersonGender": {
"type": "integer",
"x-enumNames": [
"Female",
"Male",
"Other"
],
"enum": [
0,
1,
2
],
"description": ""
},
Right now the generator has to generate a "special" description so that the user knows the mapping - but this is not very structured.
If there's an x-enumNames property in an enum schema, render the name in the dropdown with the same index as the value and submit the correct enum value. This way the description is not needed anymore.
Right now we are using the description with the mappings - but that is not optimal...
Refs:
Is it different from x-enum-descriptions extension?
The x-enumNames extension (generated by NSwagStudio in our case) includes the human readable name of an enum when you're using integers for enum rather than strings It would be great if ReDoc could support being able to display what the integer element of an enum value means, rather than just the value
Currently it shows as Valid values: 0 1 2
Showing something like Valid values: Female (0) Male (1) Other (2) would be really useful