Redocly / Redocly/redoc

`allOf` schemas that has `if-then` inside do not render properly

Open
#2,142 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

We are having issues rendering allOf schemas that has if-then inside. We are using redocly versions

"redoc": "2.0.0-rc.73",

"redoc-cli": "^0.13.16",

I am attaching here “layers.schema.current.json” where line 168 consists of a then clause and this json is rendering fine. Our actual schema is as described on “layers.schema.actual.json” and here if you refer to line 168 you will notice an allOf. But this schema fails to render with the current redocly version. Whereas it is as per openAPI standard https://json-schema.org/understanding-json-schema/UnderstandingJSONSchema.pdf (See 4.12.3 If-Then-Else) . allOf schema was working with "redoc": "2.0.0-rc.38".

Note: layers.schema.current.json is called from post_document_operations.schema. I am attaching post_document_operations.schema for debugging help.

Additional context
Aforemetioned schemas here: Archive.zip

Front logo Front conversations

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 comparing layers.schema.current.json and layers.schema.actual.json around line 168, then trace how post_document_operations.schema references them. Use Archive.zip to reproduce rendering with the reported Redoc versions, and confirm the fix when the allOf schema containing if-then renders correctly without regressing the working schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.