Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Feb 2, 2025
1 parent 0c65031 commit 858b93e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/openapi/oas_no_ref_siblings.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ func (nrs OASNoRefSiblings) RunRule(nodes []*yaml.Node, context model.RuleFuncti
var results []model.RuleFunctionResult
siblings := context.Index.GetReferencesWithSiblings()
for _, ref := range siblings {
notAllowedKeys := notAllowedKeys(ref.Node)
if len(notAllowedKeys) != 0 {
keys := notAllowedKeys(ref.Node)
if len(keys) != 0 {
key, val := utils.FindKeyNode("$ref", ref.Node.Content)
results = append(results, model.RuleFunctionResult{
Message: "a `$ref` can only be placed next to `summary` and `description` but got:" + strings.Join(notAllowedKeys, " ,"),
Message: "a `$ref` can only be placed next to `summary` and `description` but got:" + strings.Join(keys, " ,"),
StartNode: key,
EndNode: vacuumUtils.BuildEndNode(val),
Path: ref.Path,
Expand Down

0 comments on commit 858b93e

Please sign in to comment.