Skip to content

Browser tab hangs and crashes when expanding operations with deeply nested oneOf schemas #10917

Description

@paulwellnerbou

Q&A (please complete the following information)

  • OS: macOS (also reproduced on Linux/Windows)
  • Browser: Chrome, Firefox
  • Version: latest
  • Method of installation: dist assets
  • Swagger-UI version: 5.32.x (current master)
  • Swagger/OpenAPI version: OpenAPI 3.0.1

Content & configuration

The example schema below is an anonymized version of our internal application's OpenAPI document, hosted publicly (with permissive CORS) so it can be loaded directly for reproduction: https://wbou.dev/swagger-ui/latest-schema.anonymized.json

Describe the bug you're encountering

Expanding an operation whose schemas use many nested oneOf compositions causes the browser tab to freeze and eventually crash.

In the example schema (OpenAPI 3.0.1, 291 component schemas), the GET /v1/resource007 response references 219 schemas and contains 23 nested oneOf nodes. Simpler operations in the same document render fine.

To reproduce...

Steps to reproduce the behavior:

  1. Open any standard Swagger UI configured with the url above, e.g. https://petstore.swagger.io/?url=https://wbou.dev/swagger-ui/latest-schema.anonymized.json
  2. Click to expand the operation GET /v1/resource007.
  3. The tab becomes unresponsive and eventually crashes.

Expected behavior

Expanding such an operation should not freeze or crash the browser tab, regardless of how deeply nested the schema compositions are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions