Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add a test for #499 #982

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading