Skip to content

Commit b5beba3

Browse files
protobuf-github-botzhangskz
authored andcommitted
Move the RubyMessage.java JSON "include defaults" to use alwaysPrintFieldsWithNoPresence.
This is no different on proto3 but treats proto2-optional differently (to make it consistent with proto3-optional). PiperOrigin-RevId: 604354927
1 parent fc41e78 commit b5beba3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ public static IRubyObject encodeJson(
700700
options.fastARef(runtime.newSymbol("format_enums_as_integers"));
701701

702702
if (emitDefaults != null && emitDefaults.isTrue()) {
703-
printer = printer.includingDefaultValueFields();
703+
printer = printer.alwaysPrintFieldsWithNoPresence();
704704
}
705705

706706
if (preserveNames != null && preserveNames.isTrue()) {

0 commit comments

Comments
 (0)