`allOf` schema with multiple patterns is incorrectly shown in generated API Doc File

Open
#2,705 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the issue with redocly preview-docs file.json using the supplied allOf schema and inspect how the generated API documentation renders both patterns and descriptions. Done means both allOf schemas appear completely and retain their own descriptions, similarly to the oneOf rendering.

Written by the indexing model from the issue text.

Description

p3 Type: Bug

Describe the bug

When you specify the following JSON Schema:

"allOf": [
            {
              "type": "string",
              "description" : "first",
              "pattern": "^(?=.*_session_id=)(?=.*auth_token=).*$"
            },
            {
              "type": "string",
              "description" : "second",
              "pattern": ".*_tracking_id=.*"
            }
          ]

The docs generated e.g. via redocly preview-docs file.json show this as mixed up and incomplete result (note how the description "first" is shown as the description of the second allOf case):

Image

Instead, you would expect both schemas to show up in the generated docs, similarly to how the docs are generated for oneOf schemas.

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

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.

More from Redocly/redoc

All issues in Redocly/redoc

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.