fastjson 2.0.4发布
1. FASTJSON 2.0介绍
FASTJSON 2.0是FASTJSON项目的重要升级,目标是为下一个十年提供一个高性能的JSON库,同一套API支持JSON/JSONB两种协议,JSONPath是一等公民,支持全量解析和部分解析,支持Java服务端、客户端Android、大数据场景。
- FASJTONS2项目地址 https://github.com/alibaba/fastjson2
- 使用介绍 https://alibaba.github.io/fastjson2/
- FASTJSON 2性能有了很大提升,具体性能数据看这里 https://alibaba.github.io/fastjson2/benchmark_cn
- FASTJSON 2的AutoType没有内置白名单,更安全 https://alibaba.github.io/fastjson2/autotype_cn
- 支持JSONSchema https://alibaba.github.io/fastjson2/json_schema_cn
- 支持JDK14 Record
- 支持GraalVM Native-Image
2. FASTJSON 2.0.4版本 介绍
经过多个热心同学的验证,2.0.4已经具备生产可用的能力,但由于是初期版本,使用到生产还需要仔细观察验证,如果遇到问题反馈提issue到 https://github.com/alibaba/fastjson2/issues
- 更好兼容fastjson 1.x #248 #255 #274 #269 #287
- 对JDK17更好支持 #265
- 修复对反序列化多ClassLoader类冲突的问题 #252
- 内置支持GeoJson #256
- 提升对kotlin的支持 #276
- JSONObject修复泛型编译警告问题 #257 #282
- 支持json schema #239 ,相关介绍看这里 https://alibaba.github.io/fastjson2/son_schema_cn
2.1 定制序列化介绍
FASTJSON2支持完善的定制序列化反序列化功能
- Feature介绍 https://alibaba.github.io/fastjson2/features_cn
- Annotation介绍 https://alibaba.github.io/fastjson2/annotations_cn
- 使用Mixin注入Anntation定制序列化和反序列化 https://alibaba.github.io/fastjson2/mixin_cn
- 实现ObjectWriter和ObjectReader实现定制序列化和反序列化 https://alibaba.github.io/fastjson2/register_custom_reader_writer_cn
3. MAVEN依赖配置
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.4</version>
</dependency>
- GraalVM版本
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.4.graal</version>
</dependency>
- Android版本
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.4.android</version>
</dependency>
- 1.x 兼容版本
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.4</version>
</dependency>
相关链接
- 相关issue 17个 https://github.com/alibaba/fastjson2/milestone/3
- 代码tag https://github.com/alibaba/fastjson2/releases/tag/2.0.4
- 标准版本 https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/2.0.4/
- graal支持版本 https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/2.0.4.graal/ (仅在GraalVM 22.1 JDK17上做过验证)
- android版本 https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/2.0.4.android/
- 1.x兼容版本 https://repo1.maven.org/maven2/com/alibaba/fastjson/2.0.4/