diff --git a/openapi3/issue499_test.go b/openapi3/issue499_test.go new file mode 100644 index 00000000..3dc980a8 --- /dev/null +++ b/openapi3/issue499_test.go @@ -0,0 +1,13 @@ +package openapi3 + +import ( + "github.com/stretchr/testify/require" + "testing" +) + +func TestIssue499(t *testing.T) { + loader := NewLoader() + loader.IsExternalRefsAllowed = true + _, err := loader.LoadFromFile("testdata/issue499/main.yml") + require.NoError(t, err) +} diff --git a/openapi3/testdata/issue499/foo.yml b/openapi3/testdata/issue499/foo.yml new file mode 100644 index 00000000..2d8bb0e0 --- /dev/null +++ b/openapi3/testdata/issue499/foo.yml @@ -0,0 +1 @@ +type: string \ No newline at end of file diff --git a/openapi3/testdata/issue499/main.yml b/openapi3/testdata/issue499/main.yml new file mode 100644 index 00000000..da1a9725 --- /dev/null +++ b/openapi3/testdata/issue499/main.yml @@ -0,0 +1,24 @@ +openapi: 3.0.0 +info: + title: 'spec' + version: 1.2.3 + +paths: + /foo: + get: + summary: get foo + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Foo" + +components: + schemas: + Foo: + type: object + properties: + id: + $ref: "./foo.yml" \ No newline at end of file