Skip to main content

integer_params_from_whole_floats

Function integer_params_from_whole_floats 

Source
pub fn integer_params_from_whole_floats(params: &mut Value, defs: &[ParamDef])
Expand description

Rewrite each top-level argument that defs declares integer and that arrives as a whole-number float (5.0) to that integer, so a client that writes every JSON number with a decimal point decodes the same as one that does not. A fractional, non-finite or inexact float stays as sent and the decoder still refuses it; nested values and other types are untouched.