Skip to main content

value_to_document

Function value_to_document 

Source
pub fn value_to_document(
    value: &Value,
    _config: &Config,
) -> Result<EureDocument, JsonToEureError>
Expand description

Convert a JSON value to an EureDocument.

This conversion produces plain data structures without any variant detection. JSON objects become Eure maps, arrays become arrays, and primitives are converted directly. Variant reconstruction is not possible without schema information.

The config parameter is accepted for API consistency but is not used for JSON to Eure conversion (variant detection requires schema information).

ยงExample

use eure_json::{value_to_document, Config};
use serde_json::json;

let json = json!({"name": "Alice", "age": 30});
let doc = value_to_document(&json, &Config::default()).unwrap();