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
pull/15730/head
Protobuf Team Bot 10 months ago committed by Sandy Zhang
parent fc41e78d7a
commit b5beba3aa1
  1. 2
      ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java

@ -700,7 +700,7 @@ public class RubyMessage extends RubyObject {
options.fastARef(runtime.newSymbol("format_enums_as_integers"));
if (emitDefaults != null && emitDefaults.isTrue()) {
printer = printer.includingDefaultValueFields();
printer = printer.alwaysPrintFieldsWithNoPresence();
}
if (preserveNames != null && preserveNames.isTrue()) {

Loading…
Cancel
Save