-
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #594: yaml "control characters are not allowed" no longer repro…
…ducible (#597)
- Loading branch information
Showing
2 changed files
with
48,167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
Oops, something went wrong.