Skip to content

Commit

Permalink
Added test for #481
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Apr 21, 2024
1 parent 1e22e02 commit 7e87545
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index/spec_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1716,3 +1716,27 @@ components:
schemas := index.GetAllDescriptions()
assert.Equal(t, 0, len(schemas))
}

func TestSpecIndex_Issue481(t *testing.T) {
yml := `openapi: 3.0.1
components:
schemas:
PetPot:
type: object
properties:
value:
oneOf:
- type: array
items:
type: object
required:
- $ref
- value`

var rootNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &rootNode)

index := NewSpecIndexWithConfig(&rootNode, CreateOpenAPIIndexConfig())
schemas := index.GetAllReferences()
assert.Equal(t, 0, len(schemas))
}

0 comments on commit 7e87545

Please sign in to comment.