Skip to main content

parse_json

Function parse_json 

Source
pub fn parse_json(text: &str) -> Result<Omm, OmmError>
Expand description

Parse a CCSDS/CelesTrak OMM in JSON encoding into an Omm.

Accepts either a single object or an array of objects (CelesTrak GP queries return an array); the first record is taken. Each member is mapped onto the shared (key, value) field set - numbers stringified, strings taken verbatim (so the Space-Track quirk of quoting numeric values is handled) - then flows through the single field mapping. Requires the json feature.