Skip to main content

optional_str

Function optional_str 

Source
pub fn optional_str<'a>(
    input: &'a Value,
    field: &str,
) -> Result<Option<&'a str>, ToolError>
Expand description

Helper to extract an optional string field from JSON input.

A wrong type is an error, never a silent None. See type_mismatch for why nothing is coerced.