Skip to content

openapi3: strip __origin__ from extension values to prevent spurious diffs#1137

Merged
fenollp merged 1 commit intogetkin:masterfrom
oasdiff:fix/strip-extensions-origin
Mar 31, 2026
Merged

openapi3: strip __origin__ from extension values to prevent spurious diffs#1137
fenollp merged 1 commit intogetkin:masterfrom
oasdiff:fix/strip-extensions-origin

Conversation

@reuvenharrison
Copy link
Copy Markdown
Contributor

@reuvenharrison reuvenharrison commented Mar 31, 2026

Summary

  • Extension values are map[string]any, so the YAML decoder injects __origin__ into them
  • Without stripping it, two specs loaded from different file paths produce different extension values, causing spurious diffs when comparing otherwise identical extensions
  • Adds stripExtensionsOrigin helper in origin.go and calls it after delete(Extensions, originKey) in all 21 UnmarshalJSON implementations, including the root T type

Test plan

  • TestOrigin_ExtensionValuesStripped — verifies __origin__ is stripped from both root (T) and nested (Info) extension object values
  • Full test suite passes: go test ./...

🤖 Generated with Claude Code

@reuvenharrison reuvenharrison force-pushed the fix/strip-extensions-origin branch from 959f841 to d0253c3 Compare March 31, 2026 11:19
Extension values are map[string]any, so the YAML decoder injects
__origin__ into them. Without stripping it, two specs loaded from
different file paths produce different extension values, causing
spurious diffs. Call stripExtensionsOrigin after delete(Extensions,
originKey) in all 21 UnmarshalJSON implementations, including the
root T type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@reuvenharrison reuvenharrison force-pushed the fix/strip-extensions-origin branch from d0253c3 to f24dfea Compare March 31, 2026 11:40
@fenollp fenollp changed the title fix: strip __origin__ from extension values to prevent spurious diffs openapi3: strip __origin__ from extension values to prevent spurious diffs Mar 31, 2026
@fenollp fenollp merged commit 12ee8b0 into getkin:master Mar 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants