Skip to content

fix: allOf cycle detection oversight#2316

Open
mromaszewicz wants to merge 1 commit intooapi-codegen:mainfrom
mromaszewicz:fix/1377-update
Open

fix: allOf cycle detection oversight#2316
mromaszewicz wants to merge 1 commit intooapi-codegen:mainfrom
mromaszewicz:fix/1377-update

Conversation

@mromaszewicz
Copy link
Copy Markdown
Member

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.

PR oapi-codegen#1377 was merged too early. This is a small follow-up tweak to make
sure that oapi-codegen#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>
@mromaszewicz mromaszewicz requested a review from a team as a code owner April 4, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant