swagger-api / swagger-api/swagger-ui

Lazy load model properties

Open
#4,280 5 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: performance cat: rendering type: enhancement
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q A
Bug or feature request? Performance Bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.11
How did you install Swagger-UI? PetStore
Which browser & version? Chrome
Which operating system? Win 10
Demonstration API definition

petstore.swagger.io/...&url=https://heldersepu.github.io/hs-scripts/swagger/4248_swagger.json

Expected Behavior

Fast expansion of model properties

Current Behavior

Very slow expansion of model properties

Possible Solution

Lazy load model properties like we do the models

Context

Looking at the current implementation, the collapsed models show right away (big thanks 2 @shockey)

Expanding small models is quick, but the largest models (such as Patrimonio ) takes quite a while, once it fully expands, expanding child models takes no time...
I believe that is because we are loading the entire tree of the model.

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

Reproduce the delay with the linked PetStore demonstration API, especially the large Patrimonio model, and inspect the existing model and property expansion flow. The change is done when model properties expand without eagerly loading the entire child tree and the observed expansion delay is substantially reduced; the issue names no files or tests to start from.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.