Skip to content

Commit

Permalink
test: add a test for #961 (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyRugalev committed Jul 10, 2024
1 parent 8c15898 commit 1a819a1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
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'

0 comments on commit 1a819a1

Please sign in to comment.