Skip to content

Commit 8c15898

Browse files
test: add a test for #499 (#982)
1 parent a7bc0ff commit 8c15898

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

openapi3/issue499_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package openapi3
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
7+
)
8+
9+
func TestIssue499(t *testing.T) {
10+
loader := NewLoader()
11+
loader.IsExternalRefsAllowed = true
12+
_, err := loader.LoadFromFile("testdata/issue499/main.yml")
13+
require.NoError(t, err)
14+
}

openapi3/testdata/issue499/foo.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type: string

openapi3/testdata/issue499/main.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
openapi: 3.0.0
2+
info:
3+
title: 'spec'
4+
version: 1.2.3
5+
6+
paths:
7+
/foo:
8+
get:
9+
summary: get foo
10+
responses:
11+
"200":
12+
description: OK
13+
content:
14+
application/json:
15+
schema:
16+
$ref: "#/components/schemas/Foo"
17+
18+
components:
19+
schemas:
20+
Foo:
21+
type: object
22+
properties:
23+
id:
24+
$ref: "./foo.yml"

0 commit comments

Comments
 (0)