Skip to content

Commit

Permalink
fixed a bug with keynodes in the index
Browse files Browse the repository at this point in the history
schemas had the wrong keynode.
  • Loading branch information
daveshanley committed Feb 2, 2025
1 parent 110d21d commit a54432a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index/utility_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import (

func (index *SpecIndex) extractDefinitionsAndSchemas(schemasNode *yaml.Node, pathPrefix string) {
var name string
var keyNode *yaml.Node
for i, schema := range schemasNode.Content {
if i%2 == 0 {
name = schema.Value
keyNode = schema
continue
}

Expand All @@ -33,7 +35,7 @@ func (index *SpecIndex) extractDefinitionsAndSchemas(schemasNode *yaml.Node, pat
FullDefinition: fullDef,
Definition: def,
Name: name,
KeyNode: schemasNode,
KeyNode: keyNode,
Node: schema,
Path: fmt.Sprintf("$.components.schemas['%s']", name),
ParentNode: schemasNode,
Expand Down

0 comments on commit a54432a

Please sign in to comment.