Skip to content

Commit

Permalink
Move the RubyMessage.java JSON "include defaults" to use alwaysPrintF…
Browse files Browse the repository at this point in the history
…ieldsWithNoPresence.

This is no different on proto3 but treats proto2-optional differently (to make it consistent with proto3-optional).

PiperOrigin-RevId: 604354927
  • Loading branch information
protobuf-github-bot authored and Copybara-Service committed Feb 5, 2024
1 parent 17bed48 commit 4d23fa0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public static IRubyObject encodeJson(
options.fastARef(runtime.newSymbol("format_enums_as_integers"));

if (emitDefaults != null && emitDefaults.isTrue()) {
printer = printer.includingDefaultValueFields();
printer = printer.alwaysPrintFieldsWithNoPresence();
}

if (preserveNames != null && preserveNames.isTrue()) {
Expand Down

0 comments on commit 4d23fa0

Please sign in to comment.