(object: &str)
| 29 | /// Panics if the schema file is missing or contains invalid JSON. |
| 30 | #[must_use] |
| 31 | pub fn load_object_schema(object: &str) -> Value { |
| 32 | let path = format!( |
| 33 | "{}/schemas/ocsf/v1.7.0/objects/{object}.json", |
| 34 | env!("CARGO_MANIFEST_DIR") |
| 35 | ); |
| 36 | let data = |
| 37 | fs::read_to_string(&path).unwrap_or_else(|_| panic!("Missing vendored schema: {path}")); |
| 38 | serde_json::from_str(&data).unwrap_or_else(|e| panic!("Invalid JSON in {path}: {e}")) |
| 39 | } |
| 40 | |
| 41 | /// Validate that all required fields from the schema are present in the event JSON. |
| 42 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected