Skip to content

Commit

Permalink
add omitempty to mutator's type & eval fields (#4433)
Browse files Browse the repository at this point in the history
* A little more efficient but also will help clients determine whether they should fallback to the default value.
* If we go ahead with this, it might be best to do so before the v6.5 release, otherwise may be considered a breaking change.
* I had issues with generating the structs from the proto; may need someone else to look at it.

---

Signed-off-by: James Phillips <jamesdphillips@gmail.com>
Co-authored-by: Cyril Cressent <cyril@sensu.io>
  • Loading branch information
jamesdphillips and ccressent authored Oct 12, 2021
1 parent e2b3da4 commit 13ab948
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
54 changes: 27 additions & 27 deletions api/core/v2/mutator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/core/v2/mutator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ message Mutator {
// and run on the Otto VM. The runtime assets will be assumed to be javascript
// assets, and the environment variables will be made available to the global
// environment of the mutator.
string type = 10 [ (gogoproto.jsontag) = "type" ];
string type = 10 [ (gogoproto.jsontag) = "type,omitempty" ];

// When the type of the mutator is "javascript", the eval field will be expected
// to hold a valid ECMAScript 5 expression.
string eval = 11 [ (gogoproto.jsontag) = "eval" ];
string eval = 11 [ (gogoproto.jsontag) = "eval,omitempty" ];
}

0 comments on commit 13ab948

Please sign in to comment.