Redocly / Redocly/redoc

Undocumented enum values are completely missing when using x-enumDescriptions

Open
#2,713 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
If I use x-enumDescriptions then only enum values with descriptions will be shown in redocly

Expected behavior
All enum values are included

Minimal reproducible OpenAPI snippet(if possible)

openapi: 3.0.3
info:
  title: Minimal API with Enum
  version: 1.0.0
paths:
  /status:
    get:
      summary: Get status
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
components:
  schemas:
    Status:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      x-enumDescriptions:
        ACTIVE: this is active state

Screenshots
Without x-enumDescriptions:

Image

With x-enumDescriptions:

Image

Additional context

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 with the minimal OpenAPI 3.0.3 snippet and compare the enum rendering with and without x-enumDescriptions. Trace the handling of enum values and their descriptions in Redoc's documentation rendering; done means ACTIVE still shows its description and INACTIVE is also displayed without one.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.