swagger-api / swagger-api/swagger-ui

OpenAPI 3.1 operation expansion is very slow in Swagger UI

Open
#10,748 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

OpenAPI 3.1 operation expansion is very slow in Swagger UI (3.0.3 is fast)

How to reproduce
  1. Fork/clone this repo: https://github.com/abrunner94/swagger-test, which has the OpenAPI spec
  2. Run npm run start
  3. Switch between Swagger and OpenAPI versions to verify the slowness
Q&A (please complete the following information)
  • OS: macOS
  • Browser: Chrome
  • Version: 122
  • Method of installation: dist assets via unpkg CDN (swagger-ui-dist)
  • Swagger-UI version: 5.17.0, 5.32.0 (regression observed); 5.1.0 (baseline fast)
  • Swagger/OpenAPI version: OpenAPI 3.1.0 (same spec rendered as 3.0.3 is fast)
Content & configuration

Full repro uses a large real-world openapi.json / openapi.yml with openapi: 3.1.0 and reproduces consistently.

Image
How can we help?

We are seeing a major performance regression when expanding operations for OpenAPI 3.1 specs in newer Swagger UI versions.

Steps to reproduce
  1. Load a large OpenAPI 3.1.0 spec.
  2. Render with swagger-ui-dist@5.32.0 (also reproducible on 5.17.0).
  3. Expand any operation.
  4. Observe multi-second delay/hang.
  5. Render the same spec as 3.0.3 and expand the same operation.
  6. Observe near-instant expansion.
Expected behavior

Operation expansion should remain responsive for OpenAPI 3.1 and be comparable to OpenAPI 3.0.3 for the same content.

Actual behavior

OpenAPI 3.1 operation expansion is significantly slower (multi-second delay), while OpenAPI 3.0.3 remains fast.

Could you confirm whether this is a known regression in the OAS 3.1 processing path and suggest a fix or recommended workaround?

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 swagger-test repository and run npm run start using the large OpenAPI 3.1 spec. Compare operation expansion in Swagger UI 5.32.0 or 5.17.0 against 5.1.0 and the same content represented as OpenAPI 3.0.3; done means expansion is responsive and comparable to the 3.0.3 behavior.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.