Skip to content

Commit

Permalink
reproduce #594
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <[email protected]>
  • Loading branch information
fenollp committed Nov 26, 2023
1 parent 582e6d0 commit c88edb5
Show file tree
Hide file tree
Showing 4 changed files with 48,170 additions and 2 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
)

// replace gopkg.in/yaml.v3 => github.com/fenollp/yaml v3-control-characters
replace gopkg.in/yaml.v3 => github.com/fenollp/yaml v0.0.0-20220916133617-ebd049cae477
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fenollp/yaml v0.0.0-20220916133617-ebd049cae477 h1:wtaXapfqJfb5laToYtlxR0vYaOIC6bPhmopeKaLW/7s=
github.com/fenollp/yaml v0.0.0-20220916133617-ebd049cae477/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
Expand Down Expand Up @@ -40,5 +42,3 @@ github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
29 changes: 29 additions & 0 deletions openapi3/issue594_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package openapi3

import (
"net/url"
"testing"

"github.com/stretchr/testify/require"
)

func TestIssue594(t *testing.T) {
sl := NewLoader()
doc, err := sl.LoadFromFile("testdata/oai_v3_stoplight.json")
require.NoError(t, err)

err = doc.Validate(sl.Context, DisableSchemaPatternValidation())
require.NoError(t, err)

//

uri, err := url.Parse("https://raw.githubusercontent.com/sendgrid/sendgrid-oai/c3aaa432b769faa47285166aca17c7ed2ea71787/oai_v3_stoplight.json")
require.NoError(t, err)

sl = NewLoader()
doc, err = sl.LoadFromURI(uri)
require.NoError(t, err)

err = doc.Validate(sl.Context, DisableSchemaPatternValidation())
require.NoError(t, err)
}
Loading

0 comments on commit c88edb5

Please sign in to comment.