Skip to content

Commit

Permalink
Addressed issue #460
Browse files Browse the repository at this point in the history
Signed-off-by: quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Feb 20, 2024
1 parent d2aeb7e commit d4dbd0b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions functions/openapi/description_duplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@ func (dd DescriptionDuplication) RunRule(nodes []*yaml.Node, context model.RuleF

// look through summaries
for _, summary := range summaries {
data := []byte(summary.Node.Value)
md5String := fmt.Sprintf("%x", md5.Sum(data))
cp := copyPasta{
value: summary.Node.Value,
node: summary.Node,
}

checkSummaries(seenSummaries, md5String, summary.Node, &results, cp, summary.Path, context)
if len(seenDescriptions) > 0 {
checkDescriptions(seenDescriptions, md5String, summary.Node, &results, cp, summary.Path, context)
if summary.Node != nil {
data := []byte(summary.Node.Value)
md5String := fmt.Sprintf("%x", md5.Sum(data))
cp := copyPasta{
value: summary.Node.Value,
node: summary.Node,
}

checkSummaries(seenSummaries, md5String, summary.Node, &results, cp, summary.Path, context)
if len(seenDescriptions) > 0 {
checkDescriptions(seenDescriptions, md5String, summary.Node, &results, cp, summary.Path, context)
}
}
}
return results
Expand Down

0 comments on commit d4dbd0b

Please sign in to comment.