Skip to content

Commit

Permalink
test: add a test for #499 (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyRugalev committed Jul 10, 2024
1 parent a7bc0ff commit 8c15898
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openapi3/issue499_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package openapi3

import (
"testing"

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

func TestIssue499(t *testing.T) {
loader := NewLoader()
loader.IsExternalRefsAllowed = true
_, err := loader.LoadFromFile("testdata/issue499/main.yml")
require.NoError(t, err)
}
1 change: 1 addition & 0 deletions openapi3/testdata/issue499/foo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type: string
24 changes: 24 additions & 0 deletions openapi3/testdata/issue499/main.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 8c15898

Please sign in to comment.