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 #961 #981

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/issue961_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 TestIssue961(t *testing.T) {
loader := NewLoader()
loader.IsExternalRefsAllowed = true
_, err := loader.LoadFromFile("./testdata/issue961/main.yml")
require.NoError(t, err)
}
41 changes: 41 additions & 0 deletions openapi3/testdata/issue961/config_param.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
oneOf:
- title: "text"
description: |
type "text": **text** is a simple string.
type: object
required:
- type
properties:
default:
type: string
position:
type: number
format: int32
minimum: 0
description: |
Position of the parameter in the output.
name:
type: string
description: "name of the parameter as used in the API"
- title: "table"
description: |
type "table"
type: object
required:
- type
properties:
default:
type: string
position:
type: number
format: int32
minimum: 0
description: |
Position of the parameter in the output.
name:
type: string
description: "name of the parameter as used in the API"
fields:
type: array
items:
$ref: '#'
4 changes: 4 additions & 0 deletions openapi3/testdata/issue961/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
components:
schemas:
configParam:
$ref: './config_param.yml'
Loading