fix: eliminate false positive diffs on identical files (issue #806)#807
Merged
reuvenharrison merged 2 commits intomainfrom Mar 16, 2026
Merged
fix: eliminate false positive diffs on identical files (issue #806)#807reuvenharrison merged 2 commits intomainfrom
reuvenharrison merged 2 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
=======================================
Coverage 89.28% 89.28%
=======================================
Files 240 240
Lines 12715 12715
=======================================
Hits 11352 11352
Misses 907 907
Partials 456 456
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:
|
Identical YAML files loaded from different paths produced spurious diffs because the origin-tracking YAML loader injects __origin__ metadata as a real key into typed Go maps (map[string]*Encoding, map[string]*ServerVariable). When the two file paths differ, __origin__.key.file differs, causing the diff engine to report the encoding (or variables) as changed. Fix by using oasdiff/kin-openapi fork with a minimal patch that deletes originKey from MediaType.Encoding and Server.Variables after JSON unmarshaling, mirroring the pattern already used for Extensions and the unmarshalStringMapP helper used by Content, Schemas, etc. Adds regression test TestDiff_IdenticalFilesNoDiff to prevent recurrence. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
e4bc939 to
50cc6bb
Compare
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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
Affected maps (3 total)
All other component maps (`Content`, `Schemas`, `Headers`, `Links`, etc.) were already handled via `unmarshalStringMapP`/`popOrigin` or `maplike.go`.
Test plan
🤖 Generated with Claude Code