fix(gemini): depth counter in inline_refs_inner only decrements on $ref resolution#1665
Merged
fix(gemini): depth counter in inline_refs_inner only decrements on $ref resolution#1665
Conversation
…ef resolution Previously depth was decremented on every object/array structural recursion step, causing schemas with 9+ levels of plain nesting to hit the depth-8 limit prematurely even when no $ref was present. Now only $ref resolution consumes a depth slot. Adds regression test `test_inline_refs_deep_plain_nesting` covering the bug. Closes #1638.
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.
Summary
inline_refs_innerdecremented thedepthcounter on every structural recursion step (object key / array element), not only on$refresolution$refcyclesdepthunchanged when recursing into object/array structure; only decrement on$refresolutionTest plan
test_inline_refs_deep_plain_nesting: 9-level nested schema with a$refat the bottom — asserts the ref is resolved to"string", not replaced with the fallback objecttest_inline_refs_simple,test_inline_refs_no_defs,test_inline_refs_depth_limitstill passcargo nextest run --workspace --features full --lib --bins— 5238 passed, 0 failedCloses #1638. Part of #1592.