mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
render empty oauth scopes
see https://github.com/pb33f/libopenapi/issues/289
This commit is contained in:
@@ -429,7 +429,7 @@ func (n *NodeBuilder) AddYAMLNode(parent *yaml.Node, entry *nodes.NodeEntry) *ya
|
||||
}
|
||||
|
||||
p := m.ToYamlNode(n, l)
|
||||
if len(p.Content) > 0 {
|
||||
if p.Content != nil {
|
||||
valueNode = p
|
||||
}
|
||||
} else if r, ok := value.(Renderable); ok {
|
||||
|
||||
@@ -16,7 +16,7 @@ type OAuthFlow struct {
|
||||
AuthorizationUrl string `json:"authorizationUrl,omitempty" yaml:"authorizationUrl,omitempty"`
|
||||
TokenUrl string `json:"tokenUrl,omitempty" yaml:"tokenUrl,omitempty"`
|
||||
RefreshUrl string `json:"refreshUrl,omitempty" yaml:"refreshUrl,omitempty"`
|
||||
Scopes *orderedmap.Map[string, string] `json:"scopes,omitempty" yaml:"scopes,omitempty"`
|
||||
Scopes *orderedmap.Map[string, string] `json:"scopes,renderZero" yaml:"scopes,renderZero"`
|
||||
Extensions *orderedmap.Map[string, *yaml.Node] `json:"-" yaml:"-"`
|
||||
low *low.OAuthFlow
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ type findValueUntyped interface {
|
||||
// ToYamlNode converts the ordered map to a yaml node ready for marshalling.
|
||||
func (o *Map[K, V]) ToYamlNode(n NodeBuilder, l any) *yaml.Node {
|
||||
p := utils.CreateEmptyMapNode()
|
||||
if o != nil {
|
||||
p.Content = make([]*yaml.Node, 0)
|
||||
}
|
||||
|
||||
var vn *yaml.Node
|
||||
|
||||
|
||||
Reference in New Issue
Block a user