Skip to content

Commit

Permalink
Added test in resolver for #481
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Apr 21, 2024
1 parent 7e87545 commit 18a817b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions index/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,3 +1411,35 @@ components:
assert.Len(t, errs, 0)

}

func TestIssue_481(t *testing.T) {

var d = `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(d), &rootNode)

config := CreateClosedAPIIndexConfig()
config.IgnoreArrayCircularReferences = true
idx := NewSpecIndexWithConfig(&rootNode, config)

resolver := NewResolver(idx)
assert.NotNil(t, resolver)

errs := resolver.Resolve()
assert.Len(t, errs, 0)

}

0 comments on commit 18a817b

Please sign in to comment.