Skip to main content

to_json

Function to_json 

Source
pub fn to_json(doc: &Document) -> Value
Expand description

Document → JSON.

The schema is the model’s serde derive and is a public contract from here on: {"meta": {…}, "blocks": [{"type": …}]}, with inline spans adjacently tagged as {"type": …, "value": …}. See the snapshot test below.