mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Added support for unevaluatedProperties as Schema and bool #118
Also ran `gofmt` across the entire project. Things need cleaning up. Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -6,63 +6,63 @@ package utils
|
||||
import "gopkg.in/yaml.v3"
|
||||
|
||||
func CreateRefNode(ref string) *yaml.Node {
|
||||
m := CreateEmptyMapNode()
|
||||
nodes := make([]*yaml.Node, 2)
|
||||
nodes[0] = CreateStringNode("$ref")
|
||||
nodes[1] = CreateStringNode(ref)
|
||||
nodes[1].Style = yaml.SingleQuotedStyle
|
||||
m.Content = nodes
|
||||
return m
|
||||
m := CreateEmptyMapNode()
|
||||
nodes := make([]*yaml.Node, 2)
|
||||
nodes[0] = CreateStringNode("$ref")
|
||||
nodes[1] = CreateStringNode(ref)
|
||||
nodes[1].Style = yaml.SingleQuotedStyle
|
||||
m.Content = nodes
|
||||
return m
|
||||
}
|
||||
|
||||
func CreateEmptyMapNode() *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.MappingNode,
|
||||
Tag: "!!map",
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.MappingNode,
|
||||
Tag: "!!map",
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func CreateEmptySequenceNode() *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.SequenceNode,
|
||||
Tag: "!!seq",
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.SequenceNode,
|
||||
Tag: "!!seq",
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func CreateStringNode(str string) *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!str",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!str",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func CreateBoolNode(str string) *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!bool",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!bool",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func CreateIntNode(str string) *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!int",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!int",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func CreateFloatNode(str string) *yaml.Node {
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!float",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
n := &yaml.Node{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!float",
|
||||
Value: str,
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user