feat(m9/T32b): JSON Schema $ref resolver (lib seam, cycle/depth-guarded) + deploy-time dangling-ref block
This commit is contained in:
@@ -571,9 +571,18 @@ public class ManagementActor : ReceiveActor
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
// M9-T32b: supply the JSON-Schema $ref resolution seam from the shared-schema
|
||||
// library so a dangling {"$ref":"lib:Name"} in a template script schema is flagged
|
||||
// here (design-time validate) consistently with the deploy path. The library is
|
||||
// pre-loaded into a name→JSON map (the seam ValidationService consumes is sync).
|
||||
var sharedSchemaRepo = sp.GetRequiredService<ISharedSchemaRepository>();
|
||||
var sharedSchemas = await sharedSchemaRepo.ListAsync();
|
||||
var schemaLibrary = sharedSchemas.ToDictionary(s => s.Name, s => s.SchemaJson, StringComparer.Ordinal);
|
||||
Func<string, string?> resolveSchemaRef = name => schemaLibrary.GetValueOrDefault(name);
|
||||
|
||||
// Run full validation pipeline (collisions, script compilation, trigger refs, bindings)
|
||||
var validationService = new TemplateEngine.Validation.ValidationService();
|
||||
var validationResult = validationService.Validate(flatConfig);
|
||||
var validationResult = validationService.Validate(flatConfig, resolveSchemaRef: resolveSchemaRef);
|
||||
|
||||
// Also detect naming collisions across the inheritance/composition graph
|
||||
var svc = sp.GetRequiredService<TemplateService>();
|
||||
|
||||
Reference in New Issue
Block a user