Skip to content

Commit

Permalink
close #594: yaml "control characters are not allowed" no longer repro…
Browse files Browse the repository at this point in the history
…ducible (#597)
  • Loading branch information
fenollp authored Nov 26, 2023
1 parent e7a726a commit fe1c5f5
Show file tree
Hide file tree
Showing 2 changed files with 48,167 additions and 0 deletions.
31 changes: 31 additions & 0 deletions openapi3/issue594_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package openapi3_test

import (
"net/url"
"testing"

"github.com/stretchr/testify/require"

"github.com/getkin/kin-openapi/openapi3"
)

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

sl := openapi3.NewLoader()
var doc *openapi3.T
if false {
doc, err = sl.LoadFromURI(uri)
} else {
doc, err = sl.LoadFromFile("testdata/oai_v3_stoplight.json")
}
require.NoError(t, err)

doc.Info.Version = "1.2.3"
doc.Paths["/marketing/contacts/search/emails"].Post = nil
doc.Components.Schemas["full-segment"].Value.Example = nil

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

0 comments on commit fe1c5f5

Please sign in to comment.