mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
more ye olde time coverage for ye tests.
This commit is contained in:
@@ -89,15 +89,7 @@ func (ex *Example) Build(ctx context.Context, keyNode, root *yaml.Node, _ *index
|
||||
expChildNodes := low.ExtractNodesRecursive(ctx, vn)
|
||||
expChildNodes.Range(func(k, v interface{}) bool {
|
||||
if arr, ko := v.([]*yaml.Node); ko {
|
||||
if ext, ok := ex.Nodes.Load(k); ok {
|
||||
if extArr, kk := ext.([]*yaml.Node); kk {
|
||||
ex.Nodes.Store(k, append(extArr, arr...))
|
||||
} else {
|
||||
ex.Nodes.Store(k, arr)
|
||||
}
|
||||
} else {
|
||||
ex.Nodes.Store(k, arr)
|
||||
}
|
||||
ex.Nodes.Store(k, arr)
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
@@ -727,9 +727,6 @@ func (s *Schema) Build(ctx context.Context, root *yaml.Node, idx *index.SpecInde
|
||||
discriminator.AddNode(key.(int), g)
|
||||
}
|
||||
}
|
||||
if n, ok := val.(*yaml.Node); ok {
|
||||
discriminator.AddNode(key.(int), n)
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,6 +50,12 @@ variables:
|
||||
low.GenerateHashString(s.Value))
|
||||
|
||||
assert.Equal(t, 1, orderedmap.Len(n.GetExtensions()))
|
||||
|
||||
// check nodes on variables
|
||||
for k := n.Variables.Value.First(); k != nil; k = k.Next() {
|
||||
assert.NotNil(t, k.Value().Value.GetKeyNode())
|
||||
assert.NotNil(t, k.Value().Value.GetRootNode())
|
||||
}
|
||||
}
|
||||
|
||||
func TestServer_Build_NoVars(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user