Redocly / Redocly/redoc

Long default values are not properly wrapped

Open
#1,075 2 comments 6 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 viewers are unable to see full list of default values when long list of default values is in use. Also default value <span> seems to be overlapping with other spans.

Screenshot 2019-10-17 at 11 15 44

Spec:

components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items: {$ref: '#/components/schemas/ValidationError'}
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items: {type: string}
          title: Location
          type: array
        msg: {title: Message, type: string}
        type: {title: Error Type, type: string}
      required: [loc, msg, type]
      title: ValidationError
      type: object
info: {title: Fast API, version: 0.1.0}
openapi: 3.0.2
paths:
  /:
    get:
      operationId: root__get
      parameters:
      - in: query
        name: p
        required: false
        schema:
          default: ['00000000', '11111111', '22222222', '33333333', '44444444', '55555555',
            '66666666', '77777777', '88888888', '99999999', '1010101010101010', '1111111111111111',
            '1212121212121212', '1313131313131313', '1414141414141414', '1515151515151515']
          items: {}
          title: P
          type: array
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema: {$ref: '#/components/schemas/HTTPValidationError'}
          description: Validation Error
      summary: Root

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 loading the supplied OpenAPI specification in a ReDoc viewer and reproduce the long default-value rendering and overlapping span behavior. Trace the viewer code responsible for displaying schema defaults; done means the full list is visible, wraps correctly, and no text overlaps.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
documentation, frontend
Issue type
Bug
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.