chore: use github.com/pb33f/go-yaml for YAML support - #8
Open
daveshanley wants to merge 1 commit into
Open
daveshanley wants to merge 1 commit into
daveshanley wants to merge 1 commit into
Conversation
Replace go.yaml.in/yaml/v4 (rc.4) with github.com/pb33f/go-yaml v0.1.0, pb33f's maintained fork of the YAML library, so jsonpath queries and overlays work on the same yaml.Node type as libopenapi and the other pb33f modules. The fork carries upstream's later encoder defaults, which wrap long lines at 80 columns. Overlay.Format and ToString now write with a Dumper pinned to the layout overlays have always had (V3 defaults, two space indent, no wrapping), so their output is unchanged. The overlay test helper uses the same settings. Co-Authored-By: Claude Opus 5.5 <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.
Moves YAML support from
go.yaml.in/yaml/v4(rc.4) togithub.com/pb33f/go-yamlv0.1.0, pb33f's maintained fork of the YAML library. libopenapi, ordered-map and testify are moving to the same module. Queries and overlays take and return*yaml.Node, so everything has to share oneyamlpackage.Changes
go.mod/go.sum.Overlay.FormatandToStringusedNewEncoder+SetIndent(2). They now write through aDumperwithWithV3Defaults(),WithIndent(2)andWithLineWidth(-1), so overlays render exactly as before.ToStringnow callsFormatinstead of building its own encoder.NodeMatchesFiletest helper uses the same settings. Without them,TestParserewrotetestdata/overlay.yamlwith wrapped lines. The fixture is unchanged in this PR.NewEncoderuses (yamlEqualsincompare.goand a test helper) only compare encoder output with itself, so layout doesn't affect them.Tests
go build ./...andgo test ./...pass. The Spectral compliance test needs the git submodule, which CI already checks out (submodules: true).🤖 Generated with Claude Code