Skip to main content

Module normalize

Module normalize 

Source
Expand description

JSON normalization for consistent Git diffs

Functions§

format_json
Format JSON with consistent formatting (2-space indent, trailing newline, sorted keys)
normalize
Normalize a JSON value for consistent Git diffs
normalize_for_compare
Normalize for comparison: like normalize_for_push, and additionally strips write-only fields (which the server never echoes back).
normalize_for_disk
Normalize a resource for storage on disk: strips the kind’s volatile and read-only fields (registry-driven) while preserving Azure’s property order. Rigg-local x-rigg-* annotations are kept.
normalize_for_push
Normalize a resource for pushing to Azure: everything normalize_for_disk strips, plus all x-rigg-* annotation keys at any depth.
redact_credentials
Strip sensitive fields from credentials objects
semantic_eq
Are two documents semantically equal for this kind (after normalization)?
strip_x_rigg_keys
Remove every x-rigg-* key at any depth (Rigg-local annotations).