Skip to content

Commit e4360ca

Browse files
authored
chore(de): switch to go.in/yaml v4 and update modules (#117)
Replace imports of gopkg.in/yaml.v3 with the new module path go.yaml.in/yaml/v4 across source and test files to prepare for the yaml v4 release candidate. Update go.mod to require the v4 module (rc.1) and add its checksums to go.sum. This change modernizes YAML handling and aligns the project with the v4 API while preserving compatibility with existing v3 artifacts.
1 parent 7b03012 commit e4360ca

16 files changed

+18
-15
lines changed

bool_or_schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package openapi
33
import (
44
"encoding/json"
55

6-
"gopkg.in/yaml.v3"
6+
"go.yaml.in/yaml/v4"
77
)
88

99
// BoolOrSchema handles Boolean or Schema type.

bool_or_schema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66

77
"github.com/stretchr/testify/require"
8-
"gopkg.in/yaml.v3"
8+
"go.yaml.in/yaml/v4"
99

1010
"github.com/sv-tools/openapi"
1111
)

callback.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package openapi
33
import (
44
"encoding/json"
55

6-
"gopkg.in/yaml.v3"
6+
"go.yaml.in/yaml/v4"
77
)
88

99
// Callback is a map of possible out-of band callbacks related to the parent operation.

extensions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"strings"
88

9-
"gopkg.in/yaml.v3"
9+
"go.yaml.in/yaml/v4"
1010
)
1111

1212
const ExtensionPrefix = "x-"

extensions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66

77
"github.com/stretchr/testify/require"
8-
"gopkg.in/yaml.v3"
8+
"go.yaml.in/yaml/v4"
99

1010
"github.com/sv-tools/openapi"
1111
)

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ retract v0.3.0 // due to a mistake, there is no real v0.3.0 release, it was poin
77
require (
88
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
99
github.com/stretchr/testify v1.11.0
10-
gopkg.in/yaml.v3 v3.0.1
10+
go.yaml.in/yaml/v4 v4.0.0-rc.1
1111
)
1212

1313
require (
1414
github.com/davecgh/go-spew v1.1.1 // indirect
1515
github.com/pmezard/go-difflib v1.0.0 // indirect
1616
golang.org/x/text v0.14.0 // indirect
17+
gopkg.in/yaml.v3 v3.0.1 // indirect
1718
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEV
88
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
99
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
1010
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
11+
go.yaml.in/yaml/v4 v4.0.0-rc.1 h1:4J1+yLKUIPGexM/Si+9d3pij4hdc7aGO04NhrElqXbY=
12+
go.yaml.in/yaml/v4 v4.0.0-rc.1/go.mod h1:CBdeces52/nUXndfQ5OY8GEQuNR9uEEOJPZj/Xq5IzU=
1113
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
1214
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
1315
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

paths.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"encoding/json"
55
"strings"
66

7-
"gopkg.in/yaml.v3"
7+
"go.yaml.in/yaml/v4"
88
)
99

1010
// Paths holds the relative paths to the individual endpoints and their operations.

ref.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"strings"
77

8-
"gopkg.in/yaml.v3"
8+
"go.yaml.in/yaml/v4"
99
)
1010

1111
// Ref is a simple object to allow referencing other components in the OpenAPI document, internally and externally.

ref_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77

88
"github.com/stretchr/testify/require"
9-
"gopkg.in/yaml.v3"
9+
"go.yaml.in/yaml/v4"
1010

1111
"github.com/sv-tools/openapi"
1212
)

0 commit comments

Comments
 (0)