Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arazzo/arazzo_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/speakeasy-api/openapi/expression"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestArazzo_ArrayOrdering_ReorderWorkflows_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/arazzo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/speakeasy-api/openapi/yml"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// TODO make it possible to choose json or yaml output
Expand Down
2 changes: 1 addition & 1 deletion arazzo/core/criterion.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/speakeasy-api/openapi/validation"
"github.com/speakeasy-api/openapi/yml"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type CriterionExpressionType struct {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/core/criterion_syncchanges_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/speakeasy-api/openapi/pointer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestCriterionTypeUnion_SyncChanges_WithStringType_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/core/criterion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/speakeasy-api/openapi/pointer"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func createCriterionWithRootNode(c Criterion, rootNode *yaml.Node) Criterion {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/core/reusable.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/speakeasy-api/openapi/validation"
values "github.com/speakeasy-api/openapi/values/core"
"github.com/speakeasy-api/openapi/yml"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type Reusable[T marshaller.CoreModeler] struct {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/core/reusable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestReusable_Unmarshal_WithReference_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/criterion/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/speakeasy-api/openapi/expression"
"github.com/speakeasy-api/openapi/validation"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// Operator represents the operator used to compare the value of a criterion.
Expand Down
2 changes: 1 addition & 1 deletion arazzo/requestbody_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/speakeasy-api/openapi/pointer"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestRequestBody_Validate_JSONPathInPayload_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion arazzo/reusable.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/speakeasy-api/openapi/sequencedmap"
"github.com/speakeasy-api/openapi/validation"
"github.com/speakeasy-api/openapi/values"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion arazzo/successaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/speakeasy-api/openapi/pointer"
"github.com/speakeasy-api/openapi/validation"
walkpkg "github.com/speakeasy-api/openapi/walk"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// SuccessActionType represents the type of action to take on success.
Expand Down
2 changes: 1 addition & 1 deletion cmd/openapi/commands/openapi/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/speakeasy-api/openapi/openapi"
"github.com/speakeasy-api/openapi/yml"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

var bootstrapCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/openapi/commands/overlay/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
overlayPkg "github.com/speakeasy-api/openapi/overlay"
"github.com/speakeasy-api/openapi/overlay/loader"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/openapi/commands/overlay/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
overlayPkg "github.com/speakeasy-api/openapi/overlay"
"github.com/speakeasy-api/openapi/overlay/loader"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion cmd/openapi/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/speakeasy-api/openapi/openapi/linter/customrules v0.0.0-20260217225223-7d484a30828f
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v3 v3.0.1
go.yaml.in/yaml/v4 v4.0.0-rc.4
)

require (
Expand Down Expand Up @@ -46,4 +46,5 @@ require (
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.34.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 2 additions & 0 deletions cmd/openapi/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9N
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U=
go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
2 changes: 1 addition & 1 deletion expression/core/value.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package core

import "gopkg.in/yaml.v3"
import "go.yaml.in/yaml/v4"

type ValueOrExpression = *yaml.Node
2 changes: 1 addition & 1 deletion expression/value.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package expression

import (
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// ValueOrExpression represents a raw value or expression in the Arazzo document.
Expand Down
2 changes: 1 addition & 1 deletion expression/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/speakeasy-api/openapi/expression"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestGetValueOrExpressionValue_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/core/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/speakeasy-api/openapi/marshaller"
"github.com/speakeasy-api/openapi/sequencedmap"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion extensions/core/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/speakeasy-api/openapi/sequencedmap"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type TestCoreModel struct {
Expand Down
2 changes: 1 addition & 1 deletion extensions/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/speakeasy-api/openapi/sequencedmap"
"github.com/speakeasy-api/openapi/yml"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion extensions/extensions_isequal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestExtensions_IsEqual_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/speakeasy-api/openapi/sequencedmap"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type ModelWithExtensions struct {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/speakeasy-api/jsonpath v0.6.3
github.com/stretchr/testify v1.11.1
github.com/vmware-labs/yaml-jsonpath v0.3.2
go.yaml.in/yaml/v4 v4.0.0-rc.4
golang.org/x/sync v0.19.0
golang.org/x/text v0.34.0
gopkg.in/yaml.v3 v3.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U=
go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
Expand Down
2 changes: 1 addition & 1 deletion hashing/hashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/speakeasy-api/openapi/internal/interfaces"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func Hash(v any) string {
Expand Down
2 changes: 1 addition & 1 deletion hashing/hashing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/speakeasy-api/openapi/yml"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type testEnum string
Expand Down
2 changes: 1 addition & 1 deletion internal/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"

"github.com/speakeasy-api/openapi/validation"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type Validator[T any] interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/interfaces/interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/speakeasy-api/openapi/validation"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// Test implementations for Model interface
Expand Down
2 changes: 1 addition & 1 deletion internal/testutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/speakeasy-api/openapi/yml"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// TODO use these more in tests
Expand Down
2 changes: 1 addition & 1 deletion internal/testutils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestCreateStringYamlNode_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/speakeasy-api/openapi/yml"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// YAMLToJSON converts a YAML node to JSON using a custom JSON writer that preserves formatting.
Expand Down
2 changes: 1 addition & 1 deletion json/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/speakeasy-api/openapi/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestYAMLToJSON_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion jsonpointer/jsonpointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/speakeasy-api/openapi/errors"
"github.com/speakeasy-api/openapi/internal/interfaces"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions jsonpointer/models_yaml_fallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// TestModel represents a simple model for testing YAML fallback
Expand Down Expand Up @@ -39,7 +39,7 @@ knownField: "known value"
unknownField: "unknown value"
`,
jsonPointer: "/unknownField",
expectedType: "*yaml.Node",
expectedType: "*libyaml.Node",
expectedVal: "unknown value",
},
{
Expand All @@ -50,7 +50,7 @@ unknownObject:
nestedField: "nested value"
`,
jsonPointer: "/unknownObject/nestedField",
expectedType: "*yaml.Node",
expectedType: "*libyaml.Node",
expectedVal: "nested value",
},
{
Expand All @@ -62,7 +62,7 @@ unknownArray:
- "item2"
`,
jsonPointer: "/unknownArray/1",
expectedType: "*yaml.Node",
expectedType: "*libyaml.Node",
expectedVal: "item2",
},
}
Expand Down
2 changes: 1 addition & 1 deletion jsonpointer/yamlnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func getYamlNodeTarget(node *yaml.Node, currentPart navigationPart, stack []navigationPart, currentPath string, o *options) (any, []navigationPart, error) {
Expand Down
2 changes: 1 addition & 1 deletion jsonpointer/yamlnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestGetTarget_YamlNode_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/oas3/core/jsonschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestJSONSchema_Unmarshal_BooleanValue_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/oas3/core/xml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/speakeasy-api/openapi/marshaller"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func parseYAML(t *testing.T, yml string) *yaml.Node {
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/oas3/jsonschema_validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func TestJSONSchema_Validate_Error(t *testing.T) {
name: "schema fails direct validation",
yml: `
"test"`,
wantErrs: []string{"[2:1] error validation-type-mismatch failed to validate either Schema [expected `object`, got `te...`] or bool [line 2: cannot unmarshal !!str `test` into bool]"},
wantErrs: []string{"[2:1] error validation-type-mismatch failed to validate either Schema [expected `object`, got `te...`] or bool [line 2: cannot construct !!str `test` into bool]"},
},
{
name: "child schema fails validation",
Expand Down
Loading