Skip to content

chore!: migrate from gopkg.in/yaml.v3 to go.yaml.in/yaml/v3 - #26

Merged
TristanSpeakEasy merged 2 commits into
mainfrom
chore/go-yaml-in-v3
Oct 16, 2026
Merged

TristanSpeakEasy merged 2 commits into
mainfrom
chore/go-yaml-in-v3

Conversation

@TristanSpeakEasy

Copy link
Copy Markdown
Member

Why

gopkg.in/yaml.v3 is archived, and speakeasy-api/openapi is moving to the maintained go.yaml.in/yaml/v3 (speakeasy-api/openapi#269). The two packages' yaml.Node types are unrelated as far as Go is concerned, so as long as jsonpath takes the old node type, openapi has to cast between them with unsafe every time it runs a query. Moving jsonpath over removes the need for that.

This replaces #20, which has been stale since July 2025 and now conflicts with main.

What changed

  • Swapped every gopkg.in/yaml.v3 import for go.yaml.in/yaml/v3 (v3.0.5). The API is the same, so no logic changed.
  • Pointed the wasm playground (cmd/wasm) at the openapi commit from #269 that's built on the new package. Without that, the playground wouldn't compile, because openapi's overlay package would still be passing old nodes.

Review notes

  • Breaking change: JSONPath.Query and friends now take and return *go.yaml.in/yaml/v3.Node. This needs a minor bump, v0.7.0.
  • Go 1.26: pulling in the newer openapi raised the go directive from 1.24.3 to 1.26.0, so consumers need a Go 1.26 toolchain. That matches what speakeasy-api/openapi already requires.
  • The openapi requirement is a pseudo-version from #269's branch. Once #269 merges and is tagged, it should move to that release. Only the js/wasm build uses it.
  • go vet reports "unreachable code" in parser.go and selector.go, but those warnings are on main too.

Testing

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
jsonpath Ready Ready Preview Oct 16, 2026 12:29am UTC

Request Review

@TristanSpeakEasy
TristanSpeakEasy merged commit 427d852 into main Oct 16, 2026
4 checks passed
@TristanSpeakEasy
TristanSpeakEasy deleted the chore/go-yaml-in-v3 branch October 16, 2026 00:34

This branch was successfully deployed

1 active deployment
Preview — 61178c86 Deployed Oct 16, 2026 by vercel[bot]
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.

1 participant