From 586239f25109d1e486f9e25a7b45c39fe8e8b696 Mon Sep 17 00:00:00 2001 From: Prajwal S N Date: Wed, 20 Dec 2023 14:07:50 +0530 Subject: [PATCH] fix(crit): use proto names in JSON Previously, the JSON output generated through `protojson.Marshal` was using camelCased names for the keys. It now uses snake_case, which is consistent with the behaviour of the Python implementation of CRIT. Signed-off-by: Prajwal S N --- crit/image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crit/image.go b/crit/image.go index 7c6fc162a..3d03b4817 100644 --- a/crit/image.go +++ b/crit/image.go @@ -34,7 +34,7 @@ func (c *CriuEntry) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprint(`{"count":"`, c.Extra, `"}`)), nil } - data, err := protojson.Marshal(c.Message) + data, err := protojson.MarshalOptions{UseProtoNames: true}.Marshal(c.Message) if err != nil { return nil, err }