Redocly / Redocly/redoc

Problems loading an schema with Redoc, performance issue?

Open
#2,463 15 comments 17 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Redocly is not able to load a yaml file, while a similar file (without one of the elements in the schema) is being loaded (but with a big delay...)
image

Expected behavior
The schema should be loaded, as it happens with the working one
image

Minimal reproducible OpenAPI snippet(if possible)
Working file:
openapi_ok.txt

Not working file:
openapi_nok.txt

Screenshots
Already included in the description and expected behavior. Additionally, attached an screenshot showing that Swagger Editor is able to load the not working file

image

Additional context
It seems to be some kind of problem when there is a big number of nested references in the schema, and the performance is somehow being degraded as this number of nested references is increased. The original file is much more complex than the ones attached, that have been created adding/removing complexity until finding one file that is not able to be loaded by Redoc.

In any case, even the working file loads very slowly, the performance degradation is quite visible.

NOTE: There are missing references in both files, as they have been created by removing elements from the final complex file, but that one have no errors (no missing references) and is not being loaded either (and it's too complex and heavy to use it for the analysis)

NOTE: Could it be related with this other issue reported: https://github.com/Redocly/redoc/issues/2240?

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 attached openapi_ok.txt and openapi_nok.txt files in Redoc and compare behavior as nested references increase. Read the related issue #2240 and use the provided files to investigate loading time and failure conditions. Done means the non-working schema loads and the performance degradation is addressed without regressing the working case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.