We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当设置 @jsonformat(shape = JsonFormat.Shape.OBJECT) 在枚举类上时,序列化正常,反序列化报错
请填写以下信息:
如何操作可以重现该问题:
public class FastJsonTest { @AllArgsConstructor @Getter @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum Type implements Serializable { A("1", "1"), B("2","2"), C("3", "3"); private final String code; private final String msg; } @AllArgsConstructor @Data public static class User implements Serializable { private String name; private Type type; } public static void main(String[] args) { JSONFactory.setUseJacksonAnnotation(true); String test = JSON.toJSONString(new User("test", Type.B)); System.out.println(test); String jsonString = JSON.toJSONString(Type.A); System.out.println(jsonString); Type type = JSONObject.parseObject(jsonString, Type.class); System.out.println(type); } }
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
建议默认禁用jackson注解支持,否则会有很多意向不到的问题
The text was updated successfully, but these errors were encountered:
fix jackson annotation JsonFormat compatible, for issue #2836
3e0bc55
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.53-SNAPSHOT/ 问题已修复,序列化结果已经和jackson一致,这种情况jackson反序列化也是不支持的。
请帮忙用2.0.53-SNAPSHOT帮忙验证,2.0.53版本预计在月底发布
Sorry, something went wrong.
mark 请问该问题是否已经解决或者可以自定义解码器来手动实现
问题已经修复,正式版本2.0.53将会在这个周末发布
https://github.com/alibaba/fastjson2/releases/tag/2.0.53 问题已修复,请用新版本
No branches or pull requests
问题描述
当设置 @jsonformat(shape = JsonFormat.Shape.OBJECT) 在枚举类上时,序列化正常,反序列化报错
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
建议默认禁用jackson注解支持,否则会有很多意向不到的问题
The text was updated successfully, but these errors were encountered: