Skip to content

Commit

Permalink
router: Tweak marshal options to EmitDefaultValues.
Browse files Browse the repository at this point in the history
  • Loading branch information
octavore committed Feb 12, 2024
1 parent 4187d48 commit 8565a1e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions router/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ import (
)

var jpb = &protojson.MarshalOptions{
UseEnumNumbers: false,
Indent: " ",
// Multiline: false,
Indent: " ",
// AllowPartial: false,
// UseProtoNames: false,
// UseEnumNumbers: false,
// EmitUnpopulated: false,
EmitDefaultValues: true,
}

func SetMarshalOptions(opt *protojson.MarshalOptions) {
jpb = opt
}

// ProtoOK renders a 200 response with JSON-serialized proto
Expand Down

0 comments on commit 8565a1e

Please sign in to comment.