Skip to content

fastjson 2.0.61版本发布

Latest

Choose a tag to compare

@wenshao wenshao released this 07 Feb 11:04
· 8 commits to main since this release

FASTJSON 2.0.61 Release Notes

Release Date: 07 Feb 2026
Tag: 2.0.61 (170f71f)

Overview

This is a regularly scheduled maintenance release with feature enhancements, performance improvements, and bug fixes. Users should upgrade as needed.

Changes & Bug Fixes

  1. Fixed issue where Jackson's @JsonProperty on methods was being ignored in record types #3893
  2. Fixed multiple ArrayIndexOutOfBoundsException issues in JSONReaderUTF8, JSONReaderASCII, and JSONReader #3883
  3. Improved performance when parsing JSON with numerous escape characters #3889
  4. Fixed conflict where global Date writer overrides @JSONField format #3864
  5. Fixed TypeUtils.castToTimestamp compatibility issues when upgrading from 1.2.83 #3906 #3907
  6. Added support for serializing non-finite numbers (NaN, Infinity) as strings #3911
  7. Added default value support for getString and other getXXX methods #3880
  8. Fixed double quotes issue in TypeUtils.cast with Long global converter #3932
  9. Added Java 8 TimeModule support including improved YearMonth support #3934 #3935
  10. Fixed scientific notation floating point deserialization errors #3917 #3939 #3955
  11. Added serialization support for org.w3c.dom.Node #3960
  12. Fixed exception when parsing object keys with emoji and escape characters #3928
  13. Fixed generic type inference for List subclasses during deserialization #3926
  14. Added support for custom error messages in JSON Schema validation #1559
  15. Added parse(InputStream) overload with default context #3946
  16. Fixed DirectByteBuffer UnsupportedOperationException for java.nio.ByteBuffer#array #3894
  17. Added support for composing multiple filters (PropertyFilter, PropertyPreFilter, etc.) #3877
  18. Fixed incorrect overflow check when parsing BigInteger as Double
  19. Enhanced security checks in hex digit processing
  20. Improved readString performance in JSONReaderUTF8/JSONReaderUTF16
  21. Fixed various issues with WriteNulls, ErrorOnNullForPrimitives, NotWriteDefaultValue, and other features
  22. Added ProGuard rules for fields affected by reflection operations
  23. Fixed cast error when using -Dfastjson2.creator=reflect #1563

Maven Dependency Configuration

Standard Version

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61</version>
</dependency>

Android 5 Optimized Version

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61.android5</version>
</dependency>

Android 8 Optimized Version (supports java.time and Optional)

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61.android8</version>
</dependency>

1.x Compatible Version

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>2.0.61</version>
</dependency>

Spring 5 Extension

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring5</artifactId>
    <version>2.0.61</version>
</dependency>

Spring 6 Extension

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring6</artifactId>
    <version>2.0.61</version>
</dependency>

JAX-RS Extension

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-jaxrs</artifactId>
    <version>2.0.61</version>
</dependency>

JAX-RS Jakarta Extension

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-jaxrs-jakarta</artifactId>
    <version>2.0.61</version>
</dependency>

Related Links


FASTJSON 2.0.61 发布说明

发布日期: 2026年2月7日
标签: 2.0.61 (170f71f)

概述

这是定期维护版本,包含功能增强、性能改进和问题修复。建议用户根据需要升级。

变更与问题修复

  1. 修复 Jackson 的 @JsonProperty 注解在 record 类型的方法上被忽略的问题 #3893
  2. 修复 JSONReaderUTF8JSONReaderASCIIJSONReader 中的多个 ArrayIndexOutOfBoundsException 问题 #3883
  3. 优化包含大量转义字符的 JSON 解析性能 #3889
  4. 修复全局 Date writer 覆盖 @JSONField format 格式的冲突问题 #3864
  5. 修复从 1.2.83 版本升级时 TypeUtils.castToTimestamp 的兼容性问题 #3906 #3907
  6. 新增支持将非有限数字(NaN、Infinity)序列化为字符串 #3911
  7. getStringgetXXX 方法新增默认值参数支持 #3880
  8. 修复使用 Long 全局转换器时 TypeUtils.cast 出现双引号的问题 #3932
  9. 新增 Java 8 TimeModule 支持,包括改进的 YearMonth 支持 #3934 #3935
  10. 修复科学计数法浮点数反序列化错误 #3917 #3939 #3955
  11. 新增对 org.w3c.dom.Node 的序列化支持 #3960
  12. 修复解析包含 emoji 和转义字符的对象键时的异常 #3928
  13. 修复 List 子类在反序列化时无法自动推断泛型类型的问题 #3926
  14. 新增 JSON Schema 校验时支持自定义错误消息 #1559
  15. 新增带默认上下文的 parse(InputStream) 重载方法 #3946
  16. 修复 DirectByteBuffer 调用 java.nio.ByteBuffer#array 时的 UnsupportedOperationException #3894
  17. 新增支持组合多个过滤器(PropertyFilterPropertyPreFilter 等)#3877
  18. 修复将 BigInteger 解析为 Double 时溢出检查不正确的问题
  19. 增强十六进制数字处理的安全检查
  20. 改进 JSONReaderUTF8/JSONReaderUTF16readString 性能
  21. 修复 WriteNullsErrorOnNullForPrimitivesNotWriteDefaultValue 等特性的多个问题
  22. 为受反射操作影响的字段添加 ProGuard 规则
  23. 修复使用 -Dfastjson2.creator=reflect 时的类型转换错误 #1563

Maven 依赖配置

标准版本

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61</version>
</dependency>

Android 5 优化版本

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61.android5</version>
</dependency>

Android 8 优化版本(支持 java.time 和 Optional)

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.61.android8</version>
</dependency>

1.x 兼容版本

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>2.0.61</version>
</dependency>

Spring 5 扩展

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring5</artifactId>
    <version>2.0.61</version>
</dependency>

Spring 6 扩展

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring6</artifactId>
    <version>2.0.61</version>
</dependency>

JAX-RS 扩展

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-jaxrs</artifactId>
    <version>2.0.61</version>
</dependency>

JAX-RS Jakarta 扩展

<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-jaxrs-jakarta</artifactId>
    <version>2.0.61</version>
</dependency>

相关链接