redoc
redoc copied to clipboard
Array of enums ignores enum's schema description when rendered
Example array schema:
{
"description": "Π ΠΎΠ»ΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ.",
"items": {
"description": "Π ΠΎΠ»Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ.\n\n* `ROLE_DEVELOPER`. Π Π°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊ (ΠΈΠΌΠ΅Π΅Ρ Π²ΡΠ΅ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠ΅ ΠΏΡΠ°Π²Π°).\n* `ROLE_MANAGER`. ΠΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ (Π½Π° Π΄Π°Π½Π½ΡΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ ΡΠ²Π»ΡΠ΅ΡΡΡ ΡΠΈΠ½ΠΎΠ½ΠΈΠΌΠΎΠΌ ΡΠ»ΠΎΠ²Π° \"Π°Π΄ΠΌΠΈΠ½\").\n* `ROLE_MEDICAL_REPRESENTATIVE`. ΠΠ΅Π΄ΠΈΡΠΈΠ½ΡΠΊΠΈΠΉ ΠΏΡΠ΅Π΄ΡΡΠ°Π²ΠΈΡΠ΅Π»Ρ.",
"example": "ROLE_DEVELOPER",
"title": "Role",
"type": "string",
"nullable": false,
"readOnly": false,
"writeOnly": false,
"enum": [
"ROLE_DEVELOPER",
"ROLE_MANAGER",
"ROLE_MEDICAL_REPRESENTATIVE"
]
},
"maxItems": 3,
"minItems": 0,
"uniqueItems": true,
"type": "array",
"nullable": false
}
That's how ReDoc renders it in response section:
That's how ReDoc renders it in parameters section:
As you may see, ReDoc ignores description of enum schema. I didn't tested how ReDoc renders it in request section, but I'm sure result will be the same as in response section.
Do you have any ideas of how to render it? I'm not sure what's the best behavior here.. Just append items description bellow array description?
@RomanGotsiy, yes, appending below seems like a good idea.
Here's some example how I see it:
Or maybe it's better to indent it a bit:
Note that I have removed line "Items Enum".
Also, we can generate description from popular extension x-enum-descriptions
Also, can we get rid of the word "Enum:" the actual name of the property in OAS (enum
) bares no meaning to the end user of the API Docs. You could name it "Options" which is the word mentioned in the Open API Specification section 4.8.6.1