Merge pull request #28997 from k-parihar/master

fix: duplicate key in entity search #28922
This commit is contained in:
Fredrik Adelöw
2025-03-05 14:12:40 +01:00
committed by GitHub
2 changed files with 15 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Added a fix in `@backstage/plugin-catalog-backend` to prevent duplicate path keys in entity search if only casing is different.
@@ -110,7 +110,16 @@ export function traverse(root: unknown): Kv[] {
// because the latter means EITHER b or c has to be present.
visit(path, item);
if (typeof item === 'string') {
output.push({ key: `${path}.${item}`, value: true });
const pathKey = `${path}.${item}`;
if (
!output.some(
kv =>
kv.key.toLocaleLowerCase('en-US') ===
pathKey.toLocaleLowerCase('en-US'),
)
) {
output.push({ key: pathKey, value: true });
}
}
}
return;