Skip to main content

pb_to_json

Function pb_to_json 

Source
pub fn pb_to_json(v: &Value) -> Value
Expand description

Converts a protobuf Value to a JSON value. NaN and infinity become null.

Struct erases the integer-ness of every number: Crossplane converts resources through structpb, which stores all numbers as f64, so an observed replicas: 3 arrives as 3.0. Serde refuses to deserialize a float into an integer field, so integral numbers are restored to JSON integers here. K8s resources have no genuinely float-typed fields this could misrepresent.