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 zhangskz committed Feb 5, 2024
1 parent fc41e78 commit b5beba3
Showing 1 changed file with 1 addition and 1 deletion.
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 b5beba3

Please sign in to comment.