Skip to content

Support "Emit fields with default values" #735

@rty813

Description

@rty813

JSON options

A proto3 JSON implementation may provide the following options:
Emit fields with default values: Fields with default values are omitted by default in proto3 JSON output. An implementation
may provide an option to override this behavior and output fields with their default values.

Given, for example, the following proto definitions:

message X{
  int n = 1;
}

my code:

x = X();
print(x.toProto3Json());

Current output: {}
What I want: {n: 0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions