Added NodeMap to all low level objects.

this sync map tracks all the nodes that apply to this object.
This commit is contained in:
quobix
2024-08-04 11:01:23 -04:00
parent 31ed123abd
commit 70f406b6cf
46 changed files with 712 additions and 44 deletions

View File

@@ -4,6 +4,7 @@ import (
"crypto/sha256"
"fmt"
"github.com/pb33f/libopenapi/datamodel/low"
"gopkg.in/yaml.v3"
"sort"
"strings"
)
@@ -19,7 +20,20 @@ type ServerVariable struct {
Enum []low.NodeReference[string]
Default low.NodeReference[string]
Description low.NodeReference[string]
KeyNode *yaml.Node
RootNode *yaml.Node
*low.Reference
low.NodeMap
}
// GetRootNode returns the root yaml node of the ServerVariable object.
func (s *ServerVariable) GetRootNode() *yaml.Node {
return s.RootNode
}
// GetKeyNode returns the key yaml node of the ServerVariable object.
func (s *ServerVariable) GetKeyNode() *yaml.Node {
return s.RootNode
}
// Hash will return a consistent SHA256 Hash of the ServerVariable object