Skip to content
Open
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
31 changes: 31 additions & 0 deletions openapi3/issue 927_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package openapi3

import (
"testing"

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

func TestIssue927(t *testing.T) {
spec := `
openapi: 3.0.0
components:
schemas:
NullableString:
type: string
nullable: true
NullableRef:
$ref: "#/components/schemas/String"
nullable: true
String:
type: string
`

sl := NewLoader()
doc, err := sl.LoadFromData([]byte(spec))
require.NoError(t, err)

require.False(t, doc.Components.Schemas["String"].Value.Nullable)
require.True(t, doc.Components.Schemas["NullableString"].Value.Nullable)
require.True(t, doc.Components.Schemas["NullableRef"].Value.Nullable)
}