Redocly / Redocly/redoc

Display example descriptions

Open
#794 1 comment 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

ReDoc supports displaying multiple request/response examples using the examples field. However, the description is not presented anywhere. Currently the only way of explaining the examples is in the main API description.

I propose the description (if present) would be displayed beneath the example selector (for the screenshot I just added one <div> containing the description):

screenshot 2019-01-25 at 12 30 30

Example OpenAPI file:

openapi: 3.0.0
info:
  title: Test
  version: 1.0.0

paths:
  /rest/stuff:
    post:
      summary: Create stuff
      requestBody:
        content:
          application/json:
            schema:
              type: object
            examples:
              Example one:
                description: This explains what example one does.
                value:
                  example: one
              Example two:
                description: This explains what example two does.
                value:
                  example: two
      responses:
        "200":
          description: stuff is created

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 OpenAPI document and inspecting the request-body example selector and its rendering path. Done means descriptions from the selected example appear beneath the selector, while examples without descriptions continue to render normally.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.