You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server端使用JSONB.toBytes序列化,client端反序列化时,如果类的字段比server端的类少,在JSONB.parseObject的时候可能会抛出异常。 String jsonString = JSONB.toJSONString(bytes); Response tppResponse1 = JSON.parseObject(jsonString, Response.class, JSONReader.Feature.FieldBased); Response tppResponse = JSONB.parseObject(bytes, Response.class, JSONReader.Feature.FieldBased);
样例代码如上,其中 JSON.parseObject不报错,JSONB.parseObject抛异常
com.alibaba.fastjson2.JSONException: name not support input : DOUBLE -77
at com.alibaba.fastjson2.JSONReaderJSONB.notSupportType(JSONReaderJSONB.java:2633)
at com.alibaba.fastjson2.JSONReaderJSONB.skipValue(JSONReaderJSONB.java:2594)
at com.alibaba.fastjson2.reader.ObjectReaderBean.processExtra(ObjectReaderBean.java:134)
at com.alibaba.fastjson2.reader.ORG_1_1_TppResponse.readJSONBObject(Unknown Source)
at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:799)
Response类定义如下: @Data public class Response implements Serializable { SpResponse mini; }
其中server返回的数据除了mini字段还有其他的field
The text was updated successfully, but these errors were encountered:
server端使用JSONB.toBytes序列化,client端反序列化时,如果类的字段比server端的类少,在JSONB.parseObject的时候可能会抛出异常。
String jsonString = JSONB.toJSONString(bytes); Response tppResponse1 = JSON.parseObject(jsonString, Response.class, JSONReader.Feature.FieldBased); Response tppResponse = JSONB.parseObject(bytes, Response.class, JSONReader.Feature.FieldBased);
样例代码如上,其中 JSON.parseObject不报错,JSONB.parseObject抛异常
com.alibaba.fastjson2.JSONException: name not support input : DOUBLE -77
Response类定义如下:
@Data public class Response implements Serializable { SpResponse mini; }
其中server返回的数据除了mini字段还有其他的field
The text was updated successfully, but these errors were encountered: