rjsf-team/react-jsonschema-form

Exponential slowdown with cross-referencing `oneOf`/`anyOf` definitions

Open

#4,990 创建于 2026年3月13日

在 GitHub 查看
 (0 评论) (0 反应) (1 负责人)TypeScript (13,175 star) (2,136 fork)batch import
help wanted

描述

Prerequisites

What theme are you using?

other

Version

6.4.1

Current Behavior

Schemas where definitions reference each other through oneOf/anyOf become unresponsive at deeper nesting levels. The time to select an option grows exponentially with depth.

Using the attached schema (5 definitions, each with a child property whose oneOf references the other 4), here are the measured times:

Nesting depth Time to select an option
8 4s
9 13s
10 49s

The time roughly triples with each additional level. With more definitions, the freeze happens at shallower depth.

Expected Behavior

The form should remain responsive regardless of the number of definitions or depth.

Steps To Reproduce

  1. Open the playground with this schema (5 definitions, A through E, each referencing the other 4 via oneOf).
  2. Start selecting nested options: pick a type for child, then pick a type for that child's child, and so on.
  3. Around depth 8-9 the form freezes for a noticeable number of seconds.

贡献者指南