Repository navigation
Fix JsonPointer for properties transferred from $ref composition branches - #154
torian257x wants to merge 1 commit into
Conversation
|
This PR addresses the B7 feedback from PR #150. I am an AI assistant working on behalf of @torian257x.
Fixed. The class_exists guard was removed from RenderJob::render(). Dedup is now handled at the correct level in RenderQueue::addRenderJob(), which uses Schema object identity to distinguish cached reuse from genuine duplicates.
Added testTransferredPropertyJsonPointerIsCorrect in B7RenderDedupTest.php, which asserts the transferred property has #[JsonPointer("/allOf/0/properties/age")]. |
|
Updated with tests that actually fail on master and pass on this branch. Bug #1 discovered: Proving test:
Bug #2 discovered: RenderQueue had no dedup, and RenderJob's All 2741 tests pass with these fixes applied (8 pre-existing failures unrelated to these changes). |
c09786e to
65e5e2a
Compare
…ches A property merged into a composed schema's class from a $ref'd allOf/anyOf/oneOf branch received the referenced definition's pointer (/$defs/...) instead of its composition branch position (/allOf/0/...). Use the branch schema's pointer so the generated #[JsonPointer] reflects where the property is composed from. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
65e5e2a to
4b7f452
Compare
|
@wol-soft — rebased onto current
PR body updated to match. |
|
I actually think we don't have a bug here. I can see the idea behind the fix but the JSON Pointer holds an RFC6901 pointer which is clearly defined to provide the path within a JSON schema which can be traversed key by key. This is actually the behaviour of the master. For the tested example: |
Summary
Rebased onto current
masterand reduced to the one fix that still reproduces there.A property merged into a composed schema's class from a
$ref'd composition branch received the referenced definition's JSON pointer (e.g./$defs/Extra/properties/age) instead of its position within the composition (/allOf/0/properties/age).PropertyAttributeSynthesizernow takes the pointer from the composition branch schema, falling back to the property's own pointer for inline branches.Test
CompositionBranchJsonPointerTest:testTransferredPropertyFromRefBranchHasCorrectJsonPointer— fails onmaster, passes with this change.testTransferredPropertyFromInlineBranchHasCorrectJsonPointer— regression guard for inline branches.What was dropped from the earlier version of this PR
The
RenderQueue::addRenderJobdeduplication +RenderJobchanges were removed. Investigation showed the duplicate render they guarded against does not occur onmaster(the full suite renders with zero duplicates once the guard is removed) — it was an artifact of the class-name cache-key change from the now-closed B5 PR (#152), not an independent issue. Per the "fix the root cause, not a workaround" review note, only the synthesizer fix remains.