feat: add file path to origin location tracking#1128
Open
reuvenharrison wants to merge 11 commits intogetkin:masterfrom
Open
feat: add file path to origin location tracking#1128reuvenharrison wants to merge 11 commits intogetkin:masterfrom
reuvenharrison wants to merge 11 commits intogetkin:masterfrom
Conversation
7 tasks
9ec47b3 to
382f0b0
Compare
Pass file path through the origin chain (yaml3 → yaml → kin-openapi) so that each Location includes which file it came from. This enables source location tracking for external $ref resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
382f0b0 to
ea052d6
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Regenerate .github/docs/*.txt to match go doc output - Document Location and Origin struct changes in README changelog - Fix docs.sh heading grep to match actual README heading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chrisharrisonkiwi
approved these changes
Feb 19, 2026
| if location != nil { | ||
| file = location.Path | ||
| } | ||
| if yamlErr = yaml.UnmarshalWithOrigin(data, v, includeOrigin, file); yamlErr == nil { |
There was a problem hiding this comment.
Yes! This line needs to be fixed.
A lot of my works services are screaming "vendor/github.com/getkin/kin-openapi/openapi3/marsh.go:28:49: not enough arguments in call to yaml.UnmarshalWithOrigin"
Contributor
Author
There was a problem hiding this comment.
Could you please provide a spec that generates this error?
There was a problem hiding this comment.
Hey, just chipping-in, here's response of the maintainers on this issue (tldr; they're reverting it). I've also closed #1130 based on this.
Updates dependencies to use the sequence origin tracking versions. Fixes origin tests to expect Location.Name populated by yaml3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The docs.sh script iterates git-tracked directories and runs go doc on each. The .claude/skills/pre-commit directory has no Go source files, causing the CI to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI docs.sh fails on non-Go directories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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
Filefield to theLocationstruct in origin tracking, propagating file paths from the YAML parser through to the OpenAPI loaderIncludeOriginis enabled, eachLocation(key positions, field positions) now carries the source file path in addition to line/columnChanges
openapi3/origin.go: AddFile stringfield toLocationstructopenapi3/loader.go: Propagate file paths from YAML decoder nodes into origin locationsopenapi3/origin_test.go: Update all 26 location literals and fix external ref test expectationTest plan
TestOrigin_WithExternalRefgo test ./...)Fileis omitempty, no behavior change whenIncludeOriginis false🤖 Generated with Claude Code