File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ +++
2+ title = " Changes announced February 5, 2024"
3+ linkTitle = " February 5, 2024"
4+ toc_hide = " true"
5+ description = " Changes announced for Protocol Buffers on February 5, 2024."
6+ type = " docs"
7+ +++
8+
9+ This topic covers breaking changes in Java, C++, and Python in the 26.x line.
10+
11+ ## JSON Formatter Option Changes {#JSON}
12+
13+ Starting in the 26.x line, the JSON formatter option to print default-valued
14+ fields is replaced with a fixed way to handle proto2 and proto3 ` optional `
15+ fields consistently.
16+
17+ * Java: ` includingDefaultValueFields() ` is replaced with
18+ ` alwaysPrintFieldsWithNoPresence() ` .
19+ * C++: ` always_print_default_values ` is replaced with
20+ ` always_print_fields_with_no_presence=True ` .
21+ * Py: ` including_default_value_fields=True ` is replaced with
22+ ` always_print_fields_with_no_presence=True ` .
23+
24+ The new flag behaves identically to the old flag on proto3 messages, but no
25+ longer applies to proto2 ` optional ` fields. The old flags applied to proto2
26+ ` optional ` fields but not proto3 ` optional ` fields.
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ no_list = "true"
99News topics provide information about past events and changes with Protocol
1010Buffers, and plans for upcoming changes.
1111
12+ * [ February 5, 2024] ( /news/2024-02-05 ) - Breaking
13+ changes in Java, C++, and Python in the 26.x line.
1214* [ January 31, 2024] ( /news/2024-01-31 ) - Breaking
1315 changes in the 26.x line for Python
1416* [ January 5, 2024] ( /news/2024-01-05 ) - Breaking
You can’t perform that action at this time.
0 commit comments