feat: add UnmarshalWithOriginTree — strip __origin__ before JSON conversion#16
Open
reuvenharrison wants to merge 28 commits intoinvopop:mainfrom
Open
feat: add UnmarshalWithOriginTree — strip __origin__ before JSON conversion#16reuvenharrison wants to merge 28 commits intoinvopop:mainfrom
reuvenharrison wants to merge 28 commits intoinvopop:mainfrom
Conversation
Pass source file path to yaml3 decoder so origin locations include the file they were parsed from. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Includes both file parameter and sequence item origin tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…diffs Simplify UnmarshalWithOrigin: replace positional withOrigin/file params with OriginOpt struct. Remove StripFromInterfaces logic from convertToJSONableObject since all openapi3 types use custom unmarshalers that bypass the yaml-level stripping anyway. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: prevent duplicate __origin__ on YAML anchor alias expansion
Picks up the fix that skips __origin__ entries during alias expansion, preventing spurious "excessive aliasing" errors on large specs with many YAML aliases. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bump: yaml3 to v0.0.4
…ersion Adds OriginTree type and extractOrigins function that strips __origin__ from the decoded map[string]any before JSON marshaling. This reduces intermediate JSON size by ~70% for large specs with origin tracking, eliminating the 5x overhead of carrying origin data through the JSON round-trip. Callers can apply the returned OriginTree to structs after json.Unmarshal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
OriginTreetype andextractOriginsfunction that strips__origin__from the decodedmap[string]anybefore JSON marshalingUnmarshalWithOriginTreeAPI returns the extracted origin tree alongside the unmarshaled structUnmarshalWithOriginis preserved (calls new API, discards tree) for backward compatibilityTest plan
TestExtractOrigins_Map— verifies extraction from nested mapsTestExtractOrigins_Slice— verifies extraction from slices with mixed elementsTestExtractOrigins_Nil— verifies nil return for scalars and maps without originTestUnmarshalWithOriginTree— end-to-end: YAML decode + extraction + struct populationTestUnmarshalWithOriginTree_Disabled— nil tree when origin is disabled🤖 Generated with Claude Code