Skip to main content

json_type_name

Function json_type_name 

Source
pub fn json_type_name(v: &Value) -> &'static str
Expand description

Name the top-level JSON type of v (null, boolean, number, string, array or object) for an error description.

Malformed-argument errors interpolate this tag instead of the value itself. Value’s Display re-serialises arbitrary client-supplied JSON, so echoing it would let a request amplify its own error response and copy attacker-controlled text into the description that RFC 8620 §3.6.1 reserves for “unstructured English text suitable for displaying to a developer” (and into any log that buffers responses).