Extract a nested Struct value from the template's `platform_config`, converting it to `serde_json::Value`.
(template: &SandboxTemplate, key: &str)
| 2110 | /// Extract a nested Struct value from the template's `platform_config`, |
| 2111 | /// converting it to `serde_json::Value`. |
| 2112 | fn platform_config_struct(template: &SandboxTemplate, key: &str) -> Option<serde_json::Value> { |
| 2113 | let config = template.platform_config.as_ref()?; |
| 2114 | let value = config.fields.get(key)?; |
| 2115 | let json = value_to_json(value); |
| 2116 | // Return None for null/empty objects so callers can distinguish |
| 2117 | // "field absent" from "field present but empty". |
| 2118 | match &json { |
| 2119 | serde_json::Value::Null => None, |
| 2120 | serde_json::Value::Object(m) if m.is_empty() => None, |
| 2121 | _ => Some(json), |
| 2122 | } |
| 2123 | } |
| 2124 | |
| 2125 | fn status_from_object(obj: &DynamicObject) -> Option<SandboxStatus> { |
| 2126 | let status = obj.data.get("status")?; |
no test coverage detected