mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 04:20:17 +00:00
fix: Check for direct reference in IsPropertyNodeRequired
This commit is contained in:
committed by
Dave Shanley
parent
d526584d4f
commit
cd63f66efe
@@ -405,6 +405,12 @@ func IsNodeRefValue(node *yaml.Node) (bool, *yaml.Node, string) {
|
||||
|
||||
// IsPropertyNodeRequired will check if a node is required within circular references
|
||||
func IsPropertyNodeRequired(node *yaml.Node, propertyName string) bool {
|
||||
// If the node we're looking at is a direct ref to another model without any properties, mark it as required
|
||||
isRef, _, _ := IsNodeRefValue(node)
|
||||
if isRef {
|
||||
return true
|
||||
}
|
||||
|
||||
_, requiredSeqNode := FindKeyNodeTop("required", node.Content)
|
||||
if requiredSeqNode == nil {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user