mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 20:47:45 +00:00
@@ -394,7 +394,7 @@ func (n *NodeBuilder) AddYAMLNode(parent *yaml.Node, entry *nodes.NodeEntry) *ya
|
|||||||
if entry.LowValue != nil {
|
if entry.LowValue != nil {
|
||||||
if vnut, ok := entry.LowValue.(low.HasValueNodeUntyped); ok {
|
if vnut, ok := entry.LowValue.(low.HasValueNodeUntyped); ok {
|
||||||
vn := vnut.GetValueNode()
|
vn := vnut.GetValueNode()
|
||||||
if vn.Kind == yaml.SequenceNode {
|
if vn != nil && vn.Kind == yaml.SequenceNode {
|
||||||
for i := range vn.Content {
|
for i := range vn.Content {
|
||||||
if len(rawNode.Content) > i {
|
if len(rawNode.Content) > i {
|
||||||
rawNode.Content[i].Style = vn.Content[i].Style
|
rawNode.Content[i].Style = vn.Content[i].Style
|
||||||
@@ -521,6 +521,13 @@ func (n *NodeBuilder) AddYAMLNode(parent *yaml.Node, entry *nodes.NodeEntry) *ya
|
|||||||
if !encodeSkip {
|
if !encodeSkip {
|
||||||
var rawNode yaml.Node
|
var rawNode yaml.Node
|
||||||
if value != nil {
|
if value != nil {
|
||||||
|
// check if is a node and it's null
|
||||||
|
if v, ko := value.(*yaml.Node); ko {
|
||||||
|
if v.Tag == "!!null" {
|
||||||
|
return parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err := rawNode.Encode(value)
|
err := rawNode.Encode(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return parent
|
return parent
|
||||||
|
|||||||
Reference in New Issue
Block a user