diff --git a/ocaml/xcp-rrdd/lib/transport/base/rrd_json.ml b/ocaml/xcp-rrdd/lib/transport/base/rrd_json.ml index b6d1095372..15f95e3de4 100644 --- a/ocaml/xcp-rrdd/lib/transport/base/rrd_json.ml +++ b/ocaml/xcp-rrdd/lib/transport/base/rrd_json.ml @@ -45,13 +45,13 @@ let ds_owner x = ) let ds_transform x = - ( "transform" - , match x with - | Rrd.Identity -> - string "identity" - | Rrd.Inverse -> - string "inverse" - ) + match x with + | Rrd.Identity -> + [] + (* This is the default when transform is absent, and not including it + makes the file smaller *) + | Rrd.Inverse -> + [("transform", string "inverse")] let bool b = string "%b" b (* Should use `Bool b *) @@ -72,7 +72,7 @@ let ds_to_json (owner, ds) = [ description ds.Ds.ds_description ; [ds_owner owner] - ; [ds_transform ds.Ds.ds_pdp_transform_function] + ; ds_transform ds.Ds.ds_pdp_transform_function ; ds_value ds.Ds.ds_value ; [ds_type ds.Ds.ds_type] ; [