From 141bc89a52a9cae3205c59726ce6572e630eaf64 Mon Sep 17 00:00:00 2001 From: Meg Stepp Date: Mon, 28 Sep 2026 12:33:16 -0400 Subject: [PATCH] chore(deps): support libopenapi v0.41.1 --- .github/workflows/build.yaml | 4 +-- cache/cache.go | 2 +- content/content.go | 2 +- errors/parameter_errors_test.go | 2 +- errors/request_errors_test.go | 2 +- errors/response_errors_test.go | 2 +- errors/spec_line_col.go | 2 +- go.mod | 14 ++++---- go.sum | 24 +++++++------- kin_parity_test.go | 2 +- request_defaults.go | 2 +- requests/validate_request.go | 2 +- responses/validate_response.go | 2 +- schema_validation/directional_schema.go | 2 +- schema_validation/directional_schema_test.go | 2 +- schema_validation/locate_schema_property.go | 2 +- .../locate_schema_property_test.go | 2 +- schema_validation/property_locator.go | 2 +- schema_validation/property_locator_test.go | 2 +- schema_validation/schema_resources.go | 33 ++++++++++++++++--- schema_validation/schema_resources_test.go | 28 +++++++++++++++- schema_validation/validate_document.go | 2 +- schema_validation/validate_document_test.go | 2 +- schema_validation/validate_schema.go | 2 +- .../validate_schema_extract_errors_test.go | 2 +- schema_validation/validate_schema_test.go | 2 +- 26 files changed, 98 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d51d8826..9f8be82b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,7 +27,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v8 with: - version: v2.8 + version: v2.12 build: name: Build runs-on: ubuntu-latest @@ -35,7 +35,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v3 with: - go-version: 1.25 + go-version: 1.26 id: go - name: Checkout code diff --git a/cache/cache.go b/cache/cache.go index ef09fdb3..6130711d 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -4,9 +4,9 @@ package cache import ( + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" ) // SchemaCacheEntry holds a compiled schema and its intermediate representations. diff --git a/content/content.go b/content/content.go index e657f48e..ad45939e 100644 --- a/content/content.go +++ b/content/content.go @@ -27,8 +27,8 @@ import ( "strings" "time" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" ) diff --git a/errors/parameter_errors_test.go b/errors/parameter_errors_test.go index 0e9e83cc..738cb565 100644 --- a/errors/parameter_errors_test.go +++ b/errors/parameter_errors_test.go @@ -7,11 +7,11 @@ import ( "context" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/datamodel/low" "github.com/pb33f/libopenapi/orderedmap" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" lowbase "github.com/pb33f/libopenapi/datamodel/low/base" diff --git a/errors/request_errors_test.go b/errors/request_errors_test.go index cc41d72d..1e127935 100644 --- a/errors/request_errors_test.go +++ b/errors/request_errors_test.go @@ -7,10 +7,10 @@ import ( "net/http" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/low" "github.com/pb33f/libopenapi/orderedmap" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" lowv3 "github.com/pb33f/libopenapi/datamodel/low/v3" diff --git a/errors/response_errors_test.go b/errors/response_errors_test.go index 1cd4b1c2..7ba2cdeb 100644 --- a/errors/response_errors_test.go +++ b/errors/response_errors_test.go @@ -7,10 +7,10 @@ import ( "net/http" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/low" "github.com/pb33f/libopenapi/orderedmap" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" lowv3 "github.com/pb33f/libopenapi/datamodel/low/v3" diff --git a/errors/spec_line_col.go b/errors/spec_line_col.go index 0c679ee9..824c1c3a 100644 --- a/errors/spec_line_col.go +++ b/errors/spec_line_col.go @@ -4,7 +4,7 @@ package errors import ( - "go.yaml.in/yaml/v4" + "github.com/pb33f/go-yaml" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/go.mod b/go.mod index 95b88056..0ecb8f78 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/pb33f/libopenapi-validator -go 1.25.7 +go 1.26.0 require ( github.com/basgys/goxml2json v1.1.1-0.20231018121955-e66ee54ceaad github.com/dlclark/regexp2 v1.12.0 github.com/go-openapi/jsonpointer v0.23.2 github.com/goccy/go-yaml v1.19.2 - github.com/pb33f/jsonpath v0.8.2 - github.com/pb33f/libopenapi v0.38.6 - github.com/pb33f/testify v0.1.0 + github.com/pb33f/go-yaml v0.1.0 + github.com/pb33f/jsonpath v0.8.4 + github.com/pb33f/libopenapi v0.41.1 + github.com/pb33f/testify v0.1.1 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 - go.yaml.in/yaml/v4 v4.0.0-rc.6 golang.org/x/text v0.38.0 ) @@ -19,7 +19,7 @@ require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/buger/jsonparser v1.1.2 // indirect github.com/go-openapi/swag/jsonname v0.26.1 // indirect - github.com/pb33f/ordered-map/v2 v2.3.1 // indirect + github.com/pb33f/ordered-map/v2 v2.3.2 // indirect golang.org/x/net v0.50.0 // indirect - golang.org/x/sync v0.21.0 // indirect + golang.org/x/sync v0.23.0 // indirect ) diff --git a/go.sum b/go.sum index 2b88717c..03722d2f 100644 --- a/go.sum +++ b/go.sum @@ -19,14 +19,16 @@ github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAg github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= -github.com/pb33f/jsonpath v0.8.2 h1:Ou4C7zjYClBm97dfZjDCjdZGusJoynv/vrtiEKNfj2Y= -github.com/pb33f/jsonpath v0.8.2/go.mod h1:zBV5LJW4OQOPatmQE2QdKpGQJvhDTlE5IEj6ASaRNTo= -github.com/pb33f/libopenapi v0.38.6 h1:rnLshOSCSLx3JmN/MnftyYcdN1FfaeRkbaBE/ZHdIXg= -github.com/pb33f/libopenapi v0.38.6/go.mod h1:8yHl64vr+ICrnzSgiwJmZ54heRqCqrhI/JL1ge+CPIY= -github.com/pb33f/ordered-map/v2 v2.3.1 h1:5319HDO0aw4DA4gzi+zv4FXU9UlSs3xGZ40wcP1nBjY= -github.com/pb33f/ordered-map/v2 v2.3.1/go.mod h1:qxFQgd0PkVUtOMCkTapqotNgzRhMPL7VvaHKbd1HnmQ= -github.com/pb33f/testify v0.1.0 h1:g48/HDU/jn2COspS4nM0scptxiKTJ4DnbX/4ehK6IZ8= -github.com/pb33f/testify v0.1.0/go.mod h1:nq283P/jJ8hXMmdhAqfj7BJIz0y+6IOHj9q0044rKt4= +github.com/pb33f/go-yaml v0.1.0 h1:zZ6Gg+ATbumXlXZNLMHIe7+zTkVqe20lx+TSYRrXEuY= +github.com/pb33f/go-yaml v0.1.0/go.mod h1:QvWdkHP5VjFYAeHMQUkaPQqREaQnBNOXmWzAjNrnSdo= +github.com/pb33f/jsonpath v0.8.4 h1:Yx7fxsKl8scgERL22WhKDs2c6gYNNUonPSWEG8Y194s= +github.com/pb33f/jsonpath v0.8.4/go.mod h1:eO6mgdhw5RgzCxm/bXTi75VUs0/cCYJzdGjMCCUEI6M= +github.com/pb33f/libopenapi v0.41.1 h1:k2TzRNoFWdwtgZK8LpmqIHIPxD/6nExHkmB7QZXBets= +github.com/pb33f/libopenapi v0.41.1/go.mod h1:okMH18Y4oyUXUSCr84u+hHe7t/gWDwoHv/f3CEls4SQ= +github.com/pb33f/ordered-map/v2 v2.3.2 h1:wDyaZ2Pv9QLh64X4utCeD5Zoi9nIv2aW3lwv172O5PQ= +github.com/pb33f/ordered-map/v2 v2.3.2/go.mod h1:1OhFrXu3OYw3kM+FXF+Ug3ugmmZ9LE8z0JfQMLvtV0w= +github.com/pb33f/testify v0.1.1 h1:mnHe7uxKt8dyNYEGUspow72VjD264DB5rOJq4bz5tJw= +github.com/pb33f/testify v0.1.1/go.mod h1:keghMqOLECF1ENzESnfM+cwPcKN5uhTOpvbtjgL6aZg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= @@ -36,8 +38,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4= -go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= @@ -54,8 +54,8 @@ golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= -golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/kin_parity_test.go b/kin_parity_test.go index c4b2a100..0faed44e 100644 --- a/kin_parity_test.go +++ b/kin_parity_test.go @@ -14,11 +14,11 @@ import ( "sync/atomic" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/testify/assert" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/request_defaults.go b/request_defaults.go index 6e9979e5..6d726796 100644 --- a/request_defaults.go +++ b/request_defaults.go @@ -11,8 +11,8 @@ import ( "net/url" "strings" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" - "go.yaml.in/yaml/v4" v3 "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/requests/validate_request.go b/requests/validate_request.go index e760f852..6f4954fd 100644 --- a/requests/validate_request.go +++ b/requests/validate_request.go @@ -12,9 +12,9 @@ import ( "regexp" "strconv" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "golang.org/x/text/language" "golang.org/x/text/message" diff --git a/responses/validate_response.go b/responses/validate_response.go index e307b863..66013b6d 100644 --- a/responses/validate_response.go +++ b/responses/validate_response.go @@ -14,9 +14,9 @@ import ( "regexp" "strconv" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "golang.org/x/text/language" "golang.org/x/text/message" diff --git a/schema_validation/directional_schema.go b/schema_validation/directional_schema.go index 12605163..52ea3528 100644 --- a/schema_validation/directional_schema.go +++ b/schema_validation/directional_schema.go @@ -8,9 +8,9 @@ import ( "fmt" "math" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/utils" - "go.yaml.in/yaml/v4" ) // SchemaValidationPurpose identifies the context in which a schema is compiled. diff --git a/schema_validation/directional_schema_test.go b/schema_validation/directional_schema_test.go index 5b5ad6a2..52b950bd 100644 --- a/schema_validation/directional_schema_test.go +++ b/schema_validation/directional_schema_test.go @@ -9,11 +9,11 @@ import ( "strings" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/testify/assert" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" ) func TestRenderSchemaForValidation_DirectionalRequiredProperties(t *testing.T) { diff --git a/schema_validation/locate_schema_property.go b/schema_validation/locate_schema_property.go index 9d70bd1e..674c5959 100644 --- a/schema_validation/locate_schema_property.go +++ b/schema_validation/locate_schema_property.go @@ -7,10 +7,10 @@ import ( "net/url" "strings" + "github.com/pb33f/go-yaml" "github.com/pb33f/jsonpath/pkg/jsonpath" "github.com/pb33f/jsonpath/pkg/jsonpath/config" "github.com/pb33f/libopenapi/utils" - "go.yaml.in/yaml/v4" ) // LocateSchemaPropertyNodeByJSONPath will locate a schema property node by a JSONPath. It converts something like diff --git a/schema_validation/locate_schema_property_test.go b/schema_validation/locate_schema_property_test.go index 3e3e1fb5..c15ec3b0 100644 --- a/schema_validation/locate_schema_property_test.go +++ b/schema_validation/locate_schema_property_test.go @@ -6,9 +6,9 @@ package schema_validation import ( "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/testify/assert" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" ) func TestLocateSchemaPropertyNodeByJSONPath_BadNode(t *testing.T) { diff --git a/schema_validation/property_locator.go b/schema_validation/property_locator.go index dce4377d..539a4447 100644 --- a/schema_validation/property_locator.go +++ b/schema_validation/property_locator.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" + "github.com/pb33f/go-yaml" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" liberrors "github.com/pb33f/libopenapi-validator/errors" "github.com/pb33f/libopenapi-validator/helpers" diff --git a/schema_validation/property_locator_test.go b/schema_validation/property_locator_test.go index d7aa2df4..6bc52df8 100644 --- a/schema_validation/property_locator_test.go +++ b/schema_validation/property_locator_test.go @@ -6,9 +6,9 @@ package schema_validation import ( "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/testify/assert" - "go.yaml.in/yaml/v4" ) func TestExtractPropertyNameFromError_InvalidPropertyName(t *testing.T) { diff --git a/schema_validation/schema_resources.go b/schema_validation/schema_resources.go index c881b7f1..00cc46f2 100644 --- a/schema_validation/schema_resources.go +++ b/schema_validation/schema_resources.go @@ -10,11 +10,11 @@ import ( "strconv" "strings" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/index" "github.com/pb33f/libopenapi/utils" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "github.com/pb33f/libopenapi-validator/cache" "github.com/pb33f/libopenapi-validator/config" @@ -290,15 +290,14 @@ func buildSchemaDocumentResources( return nil, nil } - schemaIndex := schema.GoLow().GetIndex() - if schemaIndex == nil || schemaIndex.GetRootNode() == nil { + if schema.GoLow().GetIndex() == nil || schema.GoLow().GetIndex().GetRootNode() == nil { return nil, nil } if !schemaHasReachableRefs(schema) { return nil, nil } - schemaPointer, ok := jsonPointerForNode(schemaIndex.GetRootNode(), schema.GoLow().GetRootNode()) + schemaIndex, schemaPointer, ok := locateSchemaRootNodeIndex(schema) if !ok { return nil, fmt.Errorf("schema node was not found in its root document") } @@ -400,6 +399,32 @@ func addReachableSchemaResources( return nil } +// locateSchemaRootNodeIndex returns the index whose document contains the schema root node and its pointer. +// +// A component schema built from a $ref node reports the resolved file's index while its +// root node stays in the referring file, so other rolodex indexes are searched as a fallback. +func locateSchemaRootNodeIndex(schema *base.Schema) (*index.SpecIndex, string, bool) { + schemaIndex := schema.GoLow().GetIndex() + rootNode := schema.GoLow().GetRootNode() + if pointer, ok := jsonPointerForNode(schemaIndex.GetRootNode(), rootNode); ok { + return schemaIndex, pointer, true + } + + rolodex := schemaIndex.GetRolodex() + if rolodex == nil { + return nil, "", false + } + for _, candidate := range append([]*index.SpecIndex{rolodex.GetRootIndex()}, rolodex.GetIndexes()...) { + if candidate == nil || candidate == schemaIndex { + continue + } + if pointer, ok := jsonPointerForNode(candidate.GetRootNode(), rootNode); ok { + return candidate, pointer, true + } + } + return nil, "", false +} + func schemaResourceIndex(foundRef *index.Reference, foundIndex *index.SpecIndex) *index.SpecIndex { if foundIndex != nil { return foundIndex diff --git a/schema_validation/schema_resources_test.go b/schema_validation/schema_resources_test.go index 5ab1a639..77033d19 100644 --- a/schema_validation/schema_resources_test.go +++ b/schema_validation/schema_resources_test.go @@ -9,13 +9,13 @@ import ( "strings" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi/datamodel" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/index" "github.com/pb33f/testify/assert" "github.com/pb33f/testify/require" - "go.yaml.in/yaml/v4" lowbase "github.com/pb33f/libopenapi/datamodel/low/base" @@ -196,6 +196,32 @@ components: assert.Contains(t, err.Error(), "schema node was not found") }) + t.Run("schema root not found and index has no rolodex", func(t *testing.T) { + var root yaml.Node + require.NoError(t, yaml.Unmarshal([]byte(`components: + schemas: + Name: + type: string`), &root)) + + var detached yaml.Node + require.NoError(t, yaml.Unmarshal([]byte(`$ref: '#/components/schemas/Name'`), &detached)) + + lowSchema := &lowbase.Schema{} + require.NoError(t, lowSchema.Build(t.Context(), detached.Content[0], index.NewSpecIndex(&root))) + schema := base.NewSchema(lowSchema) + require.Nil(t, schema.GoLow().GetIndex().GetRolodex()) + + resourceSet, err := buildSchemaDocumentResources( + schema, + SchemaValidationPurposeGeneric, + nil, + ) + + assert.Nil(t, resourceSet) + require.Error(t, err) + assert.Contains(t, err.Error(), "schema node was not found") + }) + t.Run("low schema with no index falls back to single schema compiler", func(t *testing.T) { var root yaml.Node require.NoError(t, yaml.Unmarshal([]byte(`$ref: '#/components/schemas/Name'`), &root)) diff --git a/schema_validation/validate_document.go b/schema_validation/validate_document.go index 02f838dc..4db2fca7 100644 --- a/schema_validation/validate_document.go +++ b/schema_validation/validate_document.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "golang.org/x/text/language" "golang.org/x/text/message" diff --git a/schema_validation/validate_document_test.go b/schema_validation/validate_document_test.go index 662d1102..c5b10adb 100644 --- a/schema_validation/validate_document_test.go +++ b/schema_validation/validate_document_test.go @@ -8,10 +8,10 @@ import ( "os" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi/datamodel" "github.com/pb33f/testify/assert" - "go.yaml.in/yaml/v4" "github.com/pb33f/libopenapi-validator/config" liberrors "github.com/pb33f/libopenapi-validator/errors" diff --git a/schema_validation/validate_schema.go b/schema_validation/validate_schema.go index 425eb59f..79274e66 100644 --- a/schema_validation/validate_schema.go +++ b/schema_validation/validate_schema.go @@ -14,9 +14,9 @@ import ( "regexp" "strconv" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "golang.org/x/text/language" "golang.org/x/text/message" diff --git a/schema_validation/validate_schema_extract_errors_test.go b/schema_validation/validate_schema_extract_errors_test.go index 2572931d..8885ec70 100644 --- a/schema_validation/validate_schema_extract_errors_test.go +++ b/schema_validation/validate_schema_extract_errors_test.go @@ -6,10 +6,10 @@ package schema_validation import ( "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/testify/assert" "github.com/pb33f/testify/require" "github.com/santhosh-tekuri/jsonschema/v6" - "go.yaml.in/yaml/v4" "golang.org/x/text/message" ) diff --git a/schema_validation/validate_schema_test.go b/schema_validation/validate_schema_test.go index afd5d550..7f4be9cd 100644 --- a/schema_validation/validate_schema_test.go +++ b/schema_validation/validate_schema_test.go @@ -7,11 +7,11 @@ import ( "encoding/json" "testing" + "github.com/pb33f/go-yaml" "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi-validator/cache" "github.com/pb33f/libopenapi-validator/config" "github.com/pb33f/testify/assert" - "go.yaml.in/yaml/v4" ) func TestLocateSchemaPropertyNodeByJSONPath(t *testing.T) {