Skip to content

Commit

Permalink
Improve parent component name validation rule
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Jan 14, 2025
1 parent 324b6ca commit f176e09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/helpers/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export const validateMetadata = (bomJson) => {
warningsList.push(
`Found parent component with ref ${comp["bom-ref"]} in metadata.component.components`,
);
} else if (comp["name"] === bomJson.metadata.component["name"]) {
} else if (
(!comp["bom-ref"] || !bomJson.metadata.component["bom-ref"]) &&
comp["name"] === bomJson.metadata.component["name"]
) {
warningsList.push(
`Found parent component with name ${comp["name"]} in metadata.component.components`,
);
Expand Down
2 changes: 1 addition & 1 deletion types/lib/helpers/validator.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f176e09

Please sign in to comment.