Skip to content

Commit

Permalink
fix(crit): use proto names in JSON
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
snprajwal committed Dec 20, 2023
1 parent ae14a82 commit 586239f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crit/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 586239f

Please sign in to comment.