Proto deserialization from json will fail on new fields or unknown enum values
<p><code>proto</code> is designed so that introduction of new fields should not break your code that runs on older version.</p>

<p>But if you're using <code>json</code> conversion in <code>java</code> using <code>protobuf-java-util</code> then your old code will break on new fields or new enum values unknown to existing code...</p>

<p>I've opened an <a href="https://github.com/google/protobuf/issues/1610" rel="nofollow">issue</a> on <code>github</code> but it does not get any attention. I hope to get some answers here.</p>

<p>Given message like this</p>

<pre><code>message Msg {
    required string sender = 1;
    required string message = 2;
}
</code></pre>

<p>if we convert this to json and print using </p>

<pre><code>JsonFormat.printer().print(msg)
</code></pre>

<p>we will have this result</p>

<pre><code>{
  "sender": "me",
  "message": "message"
}
</code></pre>

<p>if we decode this json to <code>Msg</code> using its builder</p>

<pre><code>JsonFormat.parser().merge(json, builder)
</code></pre>

<p>we will get expected result... But if we try to decode similar <code>json</code> with additional <code>extra</code> field</p>

<pre><code>{
  "sender": "me",
  "message": "message",
  "extra" : "some extra stuff"
}
</code></pre>

<p>we will fail with this exception</p>

<pre><code>com.google.protobuf.InvalidProtocolBufferException: Cannot find field: extra in message proto.Msg
</code></pre>

<p>How is that nobody cares about this problem? So far my only solution to this is to write a parser from scratch that will ignore unknown fields and unknown enum values when parsing...</p>

<p>Is there something i overlooked or people simply dont use backwards compatibility features?</p>