Commit cd4f5aa
fix: allOf cycle detection oversight (#2316)
PR #1377 was merged too early. This is a small follow-up tweak to make
sure that #1373 is fixed properly.
seed allOf[0] ref into cycle detection to prevent stack overflow when self-ref is first
When the self-referencing $ref appears at position 0 in allOf, its
ref was never added to seenSchemaRef. If s1's own AllOf contained a
back-reference to itself, mergeAllOf would not detect the cycle.
Seed allOf[0].Ref into a top-level seen set that is copied into each
iteration's seenSchemaRef map, closing this gap.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 20bf6e1 commit cd4f5aa
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
| 55 | + | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
| |||
0 commit comments