Redocly / Redocly/redoc

Array of enums ignores enum's schema description when rendered

Open
#905 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

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:

image

That's how ReDoc renders it in parameters section:

image

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied array-of-enums schema in ReDoc's response and parameters renderings, then compare how the enum item's description is handled in each view. Done means the enum schema description is visibly rendered for the array in the affected sections, including the documented request section if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.