Skip to main content

validate_optional_string_length_value

Function validate_optional_string_length_value 

Source
pub fn validate_optional_string_length_value(
    field: &str,
    value: &Value,
    min: usize,
    max: usize,
) -> Result<(), AwsServiceError>
Expand description

Validate an optional string length from a JSON value, rejecting non-string types.

Unlike validate_optional_string_length, this takes a raw serde_json::Value so non-string inputs (numbers, arrays, objects) surface as a SerializationException instead of silently being treated as missing via Value::as_str() -> None.