Closed
Conversation
The origin-tracking YAML loader injects __origin__ as a key inside any map-valued field to record source location. Typed Go maps (map[string]*Encoding, map[string]*ServerVariable) treat __origin__ as a real entry, causing false positive diffs when the same spec is loaded from two different file paths (issue oasdiff/oasdiff#806). Fix by deleting originKey from these maps after JSON unmarshaling, mirroring the existing pattern for Extensions and the unmarshalStringMapP helper already used by Content, Schemas, Headers, etc. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… types Run docs.sh to regenerate .github/docs/openapi3.txt after the type changes in encoding.go and server.go (map[string]*Encoding → Encodings, map[string]*ServerVariable → ServerVariables). Add v0.135.0 breaking API changes entries to README.md. 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>
…ping in sequence (getkin#808) fix: prevent false positive diffs (getkin#806) and panic on empty mapping in sequence (getkin#808)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows consumers to depend on this fork directly without a replace directive, fixing go install failures (oasdiff/oasdiff#810). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: rename module path to github.com/oasdiff/kin-openapi
Merges upstream commits: - openapi3: strip __origin__ from Encodings and ServerVariables maps (getkin#1132) - fix: update yaml3 to prevent panic on empty mapping node in sequence (getkin#1133) Both fixes were already present in oasdiff/kin-openapi; this merge aligns the fork's git history with upstream to minimize divergence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
stripOriginFromAny only recursed into map[string]any but not []any, so __origin__ keys inside array elements (e.g. example values with lists of objects) survived stripping and caused false positive diffs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Picks up the fix that skips __origin__ entries during alias expansion, preventing spurious "excessive aliasing" errors on large specs with many YAML aliases (follow-up to oasdiff/oasdiff#821). Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The alias/excessive-aliasing fix is in oasdiff/yaml3; no test is needed at the kin-openapi level. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…d mappings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bump: yaml and yaml3 to v0.0.4
fix: strip `__origin__` from slices in example values
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>
fix: strip __origin__ from extension values to prevent spurious diffs
…st race The package-level IncludeOrigin global was set without cleanup in HTTP handlers, permanently contaminating all subsequent requests on the same process. Add Loader.IncludeOrigin as the safe per-loader alternative; each unmarshal call ORs it with the global for backward compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace originFromMap with originFromSeq to handle the new flat sequence format: [key_name, key_line, key_col, nf, f1_name, f1_delta, f1_col, ..., ns, s1_name, s1_count, ...]. File is now stored in OriginTree rather than repeated per location. Also extend the Value/Schema pass-through in applyOriginsToStruct to cover AdditionalProperties.Schema (no json tag), and add toInt helper for yaml int types (int vs uint64). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arshalJSON The compact __origin__ sequence now carries the file path at index 0. Update originFromSeq to read file from s[0] (remove file parameter). Add Origin.UnmarshalJSON so __origin__ can be parsed directly during JSON decoding when the caller does not use UnmarshalWithOriginTree. Also add float64 handling in toInt for JSON-decoded []any sequences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
perf: compact __origin__ format — 4× faster loading for large specs
Picks up the integer-key OriginTree fix (HTTP response codes like 200) and the compact __origin__ format with file path at index 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chore: bump yaml to v0.0.7, yaml3 to v0.0.5
…okup Sequence items now encode (value_str, delta, col); update parser to set Location.Name from the value string so NewSourceFromSequenceItem can match required/enum items by value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: sequence item Name + bump yaml3 v0.0.6
extractOrigins strips __origin__ before JSON marshaling, making the
following per-type calls in UnmarshalJSON unreachable:
- stripExtensionsOrigin(x.Extensions) — 21 call sites
- stripOriginFromAny(...) on any-typed fields (Schema.Enum/Default/Example,
Link.RequestBody, Example.Value, MediaType.Example, Parameter.Example)
- if k == originKey { ... } blocks in maplike.go (Responses, Paths, Callback)
- popOrigin() in stringmap.go replaced with delete(m, originKey), then
removed entirely since __origin__ never reaches these unmarshalers
Also adds origin tests: RequiredSequence, YAMLAlias, Headers,
IntegerStatusCode, Disabled, AnyFieldsStripped, MaplikeNoOriginKey,
WithExternalRef (uncommented assertions), and a bulk LoadAllTestdata
test that loads 26 specs with IncludeOrigin=true to catch regressions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Upstream added stripExtensionsOrigin/stripOriginFromAny calls and bumped yaml/yaml3 to v0.0.4; our OriginTree approach supersedes the explicit stripping and our yaml versions are newer (v0.0.6/v0.0.7). 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.
Merges 3 commits from
getkin/kin-openapimaster that were already superseded by our OriginTree approach:12ee8b0— strip__origin__from extension values (we removed these calls in cleanup PR cleanup: remove dead origin-stripping code now handled by extractOrigins #12)c132e59— strip__origin__from slices in example values (same)51a969a— bump yaml/yaml3 to v0.0.4 (our versions are v0.0.6/v0.0.7)Conflicts resolved in our favor throughout.
🤖 Generated with Claude Code