Address second round of PR review comments

- Close async iterators in ModelHolder after reading first value to
  prevent resource leaks
- Catch exceptions from validateMetaSchema in Zod refine predicate
  so validation errors flow through Zod's normal issue reporting
- Warn on duplicate catalog model layer IDs instead of silently
  dropping later entries
- Replace `as any` with `as JsonObject` for schema import in
  scaffolder template model layer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
Fredrik Adelöw
2026-04-14 13:59:39 +02:00
parent 445aefd4b9
commit 173ef97b48
5 changed files with 42 additions and 24 deletions
@@ -15,6 +15,7 @@
*/
import { createCatalogModelLayer } from '@backstage/catalog-model/alpha';
import { JsonObject } from '@backstage/types';
import schema from './Template.v1beta3.schema.json';
/**
@@ -47,7 +48,7 @@ export const templateModelLayer = createCatalogModelLayer({
},
],
schema: {
jsonSchema: schema as any,
jsonSchema: schema as JsonObject,
},
},
],