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:
Dave Shanley
2022-11-04 09:50:20 -04:00
parent 131513a6f6
commit a184c5e909
34 changed files with 220 additions and 161 deletions

View File

@@ -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)