Serializes spec to the JSON contract consumed by the Rust backend.
spec
Usage
Source
rust.spec_to_json(spec)