Skip to main content

validate_snapshot_json

Function validate_snapshot_json 

Source
pub fn validate_snapshot_json(json: &str) -> SchemaValidationResult
Expand description

Validate that a JSON string is a well-formed SimulationSnapshot.

Checks:

  • Parses as valid JSON object
  • Contains required top-level keys
  • bodies is an array
  • All body entries have handle, position, velocity fields
  • time and gravity are finite numbers / arrays