Record block end in the __origin__ sequence#10
Closed
reuvenharrison wants to merge 1 commit into
Closed
Conversation
067d231 to
fc26e60
Compare
78283ac to
9b05bd6
Compare
fc26e60 to
bc94667
Compare
9b05bd6 to
e80e035
Compare
bc94667 to
18ca61c
Compare
e80e035 to
0c3aef0
Compare
18ca61c to
e6bf064
Compare
ae7bb39 to
b83981f
Compare
e6bf064 to
102a24c
Compare
b83981f to
bf9f7e6
Compare
buildOriginSeq now appends end_delta (line delta from key_line) and end_col for the whole mapping block, using the node EndLine/EndColumn added in the previous commit. This lets a consumer reconstruct an element's full span (e.g. an entire endpoint operation block) from its origin, not just the start. Appended after the sequences section so a consumer that stops there (today's kin-openapi originFromSeq) ignores the new fields -- backward compatible, no lockstep release required. TestOrigin_BlockEnd asserts the end reconstructs the block's last content line without bleeding into the next sibling; the existing golden origin tests are updated for the two new trailing entries. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
102a24c to
0ea83a6
Compare
bf9f7e6 to
0e5f333
Compare
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.
Stacked on #9 (depends on
Node.EndLine/EndColumn). Retarget tov3once #9 merges.What
buildOriginSeqappends two fields to each__origin__sequence:end_delta(line delta fromkey_line) andend_col, marking the end of the whole mapping block.Why
A consumer can now reconstruct an element's full span from its origin, e.g. the entire endpoint operation block, not just its start line. This is what kin-openapi (and then oasdiff
changelog/ the review page) needs to point at and extract an affected endpoint.Compatibility
Appended after the sequences section. The current kin-openapi
originFromSeqreturns once it has parsed the sequences and ignores trailing fields, so this needs no lockstep release: yaml3 can ship first, kin-openapi reads the new fields when it's updated.Tests
TestOrigin_BlockEndasserts the reconstructed end is the block's last content line and does not bleed into the following sibling.