Files
libopenapi/datamodel/low/reference.go
Dave Shanley bdb9aa7c41 Working through building out schema models.
Perhaps the most complex model in the stack, almost there! a small amount of refactoring also to help things stay clean.
2022-08-05 12:47:50 -04:00

28 lines
437 B
Go

package low
import "gopkg.in/yaml.v3"
type HasNode interface {
GetNode() *yaml.Node
}
type Buildable interface {
Build(node *yaml.Node) error
}
type NodeReference[T any] struct {
Value T
ValueNode *yaml.Node
KeyNode *yaml.Node
}
type ObjectReference struct {
Value interface{}
ValueNode *yaml.Node
KeyNode *yaml.Node
}
func (n NodeReference[T]) IsEmpty() bool {
return n.KeyNode == nil && n.ValueNode == nil
}