Redocly / Redocly/redoc

Schema causing ReDoc to run out of memory

Open
#696 12 comments 9 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

We have a rather large schema that is causing Redoc to fail to render as the browser runs out of memory.

I have tried utilising redoc-cli to bundle but this will run seemingly forever and never complete.

The schema can be found here: https://gist.github.com/AlexRichter/001f64d9c5ac17a8a0bfdb1a771eef71

I have tried creating a minimal use case but can't as I believe the issue is due to the complexity of the schema.

You can fix it by removing some of the oneOf and discriminator in CheckResource. If you only have 3 it will render quickly, up to 5 and it takes ~18 seconds. All of them and it will never complete.

Your help is much appreciated!

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 linked schema gist and the CheckResource section, then reproduce the behavior using redoc-cli and the browser. Compare rendering with the reduced oneOf and discriminator cases described in the issue; done means the full schema renders without the browser running out of memory or redoc-cli hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.