Skip to main content

sorted_json

Function sorted_json 

Source
pub fn sorted_json(value: &Value) -> String
Expand description

The compact JSON text of value, with every object’s keys sorted.

serde_json writes an object’s keys in the order they arrived when any crate in the build enables its preserve_order feature, and cedar-policy does. Text that is hashed, published as a digest, or matched by a policy goes through here instead, so reordering keys changes none of them.