Skip to content

Commit a08478b

Browse files
authored
Merge pull request #127 from ozontech/emit-defaults-protojson
Improve protojson marshal options
2 parents 0355d7d + 4fe8239 commit a08478b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/allure/parameter.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ func (p *Parameter) MarshalJSON() ([]byte, error) {
190190
var value string
191191

192192
if msg, ok := p.Value.(proto.Message); ok {
193-
res, err := protojson.Marshal(msg)
193+
res, err := protojson.MarshalOptions{
194+
AllowPartial: true,
195+
EmitDefaultValues: true,
196+
EmitUnpopulated: true,
197+
}.Marshal(msg)
194198
if err != nil {
195199
return nil, fmt.Errorf("protojson marshal: %w", err)
196200
}

0 commit comments

Comments
 (0)