bivas / protobuf-java-format

Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
BSD 3-Clause "New" or "Revised" License
152 stars 97 forks source link

JsonFormat#printUnknownFIelds produce invalid JSON #57

Open George-A opened 5 years ago

George-A commented 5 years ago

This method may produce invalid json with hex numbers. The convention on json:

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf Numbers

A number is a sequence of decimal digits with no superfluous leading zero. It may have a preceding minus sign (U+002D). It may have a fractional part prefixed by a decimal point (U+002E).It may have an exponent, prefixed by e(U+0065) or E(U+0045) and optionally +(U+002B) or –(U+002D). The digits are the code points U+0030 through U+0039

The json produced by this method not parsed by another Json libraries. For example jackson.