swagger-api / swagger-api/swagger-ui
"Lazy resolver" feature introduced in v3.11.0 slows down expanding operations in OAS3 spec
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Windows 10
- Browser: Chrome, Firefox
- Version: Chrome 71, Firefox 65
- Method of installation: swagger-ui dist in IIS
- Swagger-UI version: 3.10.0 vs 3.11.0 - 3.20.6
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
https://pastebin.com/raw/Zh5ZGN17
Note: This spec is obfuscated
Swagger-UI configuration options:
Swagger editor default settings
Describe the bug you're encountering
In version 3.11.0, the "Lazy resolver" feature was introduced, which is supposed to significantly improving performance. However, using our OpenAPI 3.0 spec (see link above), the performance dramatically drops instead of improves.
For example, when clicking operations GET /HHUTVNQGQCUN or GET /KAYQPVEJWLYY, you have to wait a really long time (varying between 2 and 20 seconds). When rolling back to version 3.10.0, the performance is back to less than 1 second. I have also tried the latest version 3.20.6, and that's also very slow.
When using the Swagger 2.0 spec of (a slightly older version of) the same API, there are no performance issues.
To reproduce...
Steps to reproduce the behavior:
- Click GET /HHUTVNQGQCUN or GET /KAYQPVEJWLYY to expand the operation
- Wait
Expected behavior
Operation expansion in less than 1 sec
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by loading the obfuscated OpenAPI 3.0 definition from the linked pastebin in Swagger UI 3.10.0 and a 3.11.0-or-newer version, then reproduce expansion of GET /HHUTVNQGQCUN and GET /KAYQPVEJWLYY. Compare the lazy resolver behavior and measure whether those operations expand in under one second, matching the Swagger 2.0 comparison.
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
- 35/100