decode_no_coerce

Function decode_no_coerce 

Source
pub fn decode_no_coerce<T>(input: &str) -> Result<T, ToonError>
Expand description

Decode without type coercion (strings remain strings).

ยงExamples

use serde_json::{
    json,
    Value,
};
use toon_format::decode_no_coerce;

// Without coercion: quoted strings that look like numbers stay as strings
let result: Value = decode_no_coerce("value: \"123\"")?;
assert_eq!(result["value"], json!("123"));

// With default coercion: unquoted "true" becomes boolean
let result: Value = toon_format::decode_default("value: true")?;
assert_eq!(result["value"], json!(true));