Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "Emit fields with default values" #735

Closed
rty813 opened this issue Aug 19, 2022 · 1 comment
Closed

Support "Emit fields with default values" #735

rty813 opened this issue Aug 19, 2022 · 1 comment

Comments

@rty813
Copy link

rty813 commented Aug 19, 2022

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}

@osa1
Copy link
Member

osa1 commented Aug 22, 2022

Duplicate of #585 (PR #592).

@osa1 osa1 closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants