Fix infinite recursion in @hey-api/transformers for self-referential schemas#2855
Merged
Conversation
|
|
🦋 Changeset detectedLatest commit: 81f91a9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…hemas Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix crash issue when retrieving battles from API
Fix infinite recursion in @hey-api/transformers for self-referential schemas
Oct 26, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2855 +/- ##
=======================================
Coverage 30.59% 30.59%
=======================================
Files 488 488
Lines 39938 39938
Branches 2442 2442
=======================================
Hits 12219 12219
Misses 27685 27685
Partials 34 34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
@hey-api/transformersplugin crashes with "Maximum call stack size exceeded" when processing schemas with self-referential$refs(e.g., tree structures where nodes contain arrays of themselves).Root Cause
In
processSchemaType(), symbol registration happened after recursive schema processing:For self-referential schemas, subsequent encounters of the same
$refduring recursion couldn't find the symbol, causing re-entry.Fix
Register symbol before processing schema:
Changes
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts- Move symbol registration before recursive callFixes #2848
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.