protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

JSON printing / parsing of `optional` fields

Open agasparovic opened this issue 4 years ago • 1 comments

Now that scalar field presence is supported in proto3 (hooray! 🎉), it should be possible for JSON printing and parsing to take advantage of it:

  • Parsing: When a field defined as optional is provided in JSON input (even if its value is the default), parsing into a proto message should result in the field being set.
  • Printing: When a field defined as optional is set in a proto message (even if its value is the default), it should be included in the JSON output when printing.

It may make sense to guard this new functionality behind a parameter like always_include_optionals_when_set in JsonParseOptions and JsonPrintOptions.

agasparovic avatar Oct 08 '21 21:10 agasparovic

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Feb 16 '24 10:02 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Mar 02 '24 10:03 github-actions[bot]