@@ -24,7 +24,7 @@ use std::collections::{BTreeMap, HashMap, HashSet};
2424use std:: path:: Path ;
2525
2626use datadog_agent_config_overlay_model:: schema_gen:: { FieldInfo , FieldType } ;
27- use datadog_agent_config_overlay_model:: { load_resolved_schema , InputShape , KnownEntry , SchemaOverlay } ;
27+ use datadog_agent_config_overlay_model:: { InputShape , KnownEntry , SchemaOverlay } ;
2828use indexmap:: IndexMap ;
2929use serde_json:: { Map , Value } ;
3030use syn:: visit_mut:: { self , VisitMut } ;
@@ -43,16 +43,13 @@ const LEAF_KEYWORDS: &[&str] = &[
4343] ;
4444
4545pub fn generate (
46- overlay : & SchemaOverlay , schema_path : & Path , schema_map : & IndexMap < String , FieldInfo > , manifest_dir : & Path ,
46+ overlay : & SchemaOverlay , composed_schema : & serde_yaml:: Value , schema_map : & IndexMap < String , FieldInfo > ,
47+ manifest_dir : & Path ,
4748) {
4849 let supported = supported_keys ( overlay) ;
4950
50- // Load the schema with all `$ref` files inlined (apm_config, multi_region_failover, ...).
51- // Without $ref resolution those subsystem keys are silently absent and the witness driver
52- // cannot cover them. Delegate to overlay-model's resolver rather than duplicating it.
53- let schema_yaml = load_resolved_schema ( schema_path) . unwrap_or_else ( |e| panic ! ( "failed to load schema: {e}" ) ) ;
5451 let schema: Value =
55- serde_json:: to_value ( schema_yaml ) . unwrap_or_else ( |e| panic ! ( "failed to convert schema to JSON: {e}" ) ) ;
52+ serde_json:: to_value ( composed_schema ) . unwrap_or_else ( |e| panic ! ( "failed to convert schema to JSON: {e}" ) ) ;
5653 let properties = schema
5754 . get ( "properties" )
5855 . and_then ( Value :: as_object)
0 commit comments