mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Updated index to count schemas, even if they are refs.
This was brought up in chat, that the expectation is that all schemas are included, refs or not. This update fixes that for the index and adds in a new individual property to count just the references `GetAllReferenceSchemas ` Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -43,6 +43,12 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
|
||||
if i%2 == 0 && n.Value == "schema" && !utils.IsNodeArray(node) && (i+1 < len(node.Content)) {
|
||||
isRef, _, _ := utils.IsNodeRefValue(node.Content[i+1])
|
||||
if isRef {
|
||||
// record this reference
|
||||
ref := &Reference{
|
||||
Node: node.Content[i+1],
|
||||
Path: fmt.Sprintf("$.%s.schema", strings.Join(seenPath, ".")),
|
||||
}
|
||||
index.allRefSchemaDefinitions = append(index.allRefSchemaDefinitions, ref)
|
||||
continue
|
||||
}
|
||||
ref := &Reference{
|
||||
|
||||
Reference in New Issue
Block a user