protobuf-java-format icon indicating copy to clipboard operation
protobuf-java-format copied to clipboard

JsonFormat.merge throw a exception when a 'message' field in json is null

Open haoyanzhang opened this issue 5 years ago • 1 comments

message A { //xxx } message B { optional A a=0; }

B.Builder builder = B.newBuild(); new JsonFormat().merge("{a: null}", ExtensionRegistry.getEmptyRegistry(), builder);

Will throw exception like Exception in thread "main" com.googlecode.protobuf.format.JsonFormat$ParseException: 1:13: Expected "{"

version 1.4

haoyanzhang avatar Dec 01 '20 06:12 haoyanzhang

这个问题你解决了吗?是不是要换低版本包,我可能也遇到同样问题了,json转proto报一样的错误

harrylee2015 avatar Jun 20 '22 13:06 harrylee2015