mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
Fixed a low level bug with locating nodes.
locating nodes was looking through two levels to locate something. This is not the correct behavior, after making the change - lots of tests needed to be updated to be correct in what they put into as a the root node.
This commit is contained in:
@@ -519,7 +519,7 @@ func TestExtractObjectRaw(t *testing.T) {
|
||||
var cNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(yml), &cNode)
|
||||
|
||||
tag, err := ExtractObjectRaw[*pizza](&cNode, idx)
|
||||
tag, err := ExtractObjectRaw[*pizza](cNode.Content[0], idx)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, tag)
|
||||
assert.Equal(t, "hello pizza", tag.Description.Value)
|
||||
@@ -1143,8 +1143,7 @@ func TestExtractMapFlat_DoubleRef(t *testing.T) {
|
||||
yml := `components:
|
||||
schemas:
|
||||
stank:
|
||||
things:
|
||||
almostWork: 99`
|
||||
almostWork: 99`
|
||||
|
||||
var idxNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &idxNode)
|
||||
|
||||
Reference in New Issue
Block a user