fastjson2 icon indicating copy to clipboard operation
fastjson2 copied to clipboard

🚄 FASTJSON2 is a Java JSON library with excellent performance.

Results 392 fastjson2 issues
Sort by recently updated
recently updated
newest added

**问题描述** 项目用到redis缓存,在缓存序列化和反序列化用fastjson2 2.0.37版本,但发现如果只java.time.LocalDate\java.time.LocalDateTime 进行序列化后再反序列化时不能还原他的类型(jackjson也这样),但java.util.Date序列化后再反序列化可以还原类型;在进行序列化时已开启Feature.WriteClassName **环境信息** OS信息: [mac os] JDK信息: [jdk1.8] 版本信息:[Fastjson2 2.0.37] **重现步骤** ``` FastJson2RedisSerializer fastJson2RedisSerializer = new FastJson2RedisSerializer(Object.class); byte[] serializea = fastJson2RedisSerializer.serialize(LocalDate.now()); byte[] serializeb = fastJson2RedisSerializer.serialize(LocalDateTime.now()); byte[] serializec =...

enhancement
question

### 问题描述 *在反序列化double类型时,com.alibaba.fastjson2.util.FDBigInteger构造函数在初始化时会使用到trimLeadingZeros方法,这个方法内部有个while操作导致cpu飙升* ### 环境信息 *请填写以下信息:* - OS信息: [e.g.:CentOS 8.4.2105 4Core 3.10GHz 16 GB] - JDK信息: [e.g.:Openjdk 1.8.0_312] - 版本信息:[e.g.:Fastjson2 2.0.47]

bug

### 问题描述 *简要描述您碰到的问题。* ### 环境信息 *请填写以下信息:* - OS信息: [e.g.:Ubuntu 20.04 4Core 3.10GHz 3 GB] - JDK信息: [e.g.:Openjdk 1.8.0_352] - 版本信息:[e.g.:Fastjson2 2.0.23] ### 重现步骤 *如何操作可以重现该问题:* 1. 使用 `xxx.xxx` 方法 2. 输入...

bug

### 问题描述 *简要描述您碰到的问题。* ### 环境信息 *请填写以下信息:* - OS信息: [e.g.:CentOS 8.4.2105 4Core 3.10GHz 16 GB] - JDK信息: [e.g.:Openjdk 1.8.0_312] - 版本信息:[e.g.:Fastjson2 2.0.18] ### 重现步骤 *如何操作可以重现该问题:* 1. 使用 `xxx.xxx` 方法 2. 输入...

bug

### What this PR does / why we need it? [FEATURE] JSON 比对 #1946 ### Summary of your change add compare util #### Please indicate you've done the following: -...

### 问题描述 *SpringBoot2.X配置了消息转换器,对于符号会转义* ### 环境信息 *请填写以下信息:* - JDK信息:亚马逊JDK-17 - 版本信息:2.0.45 ### 重现步骤 *如何操作可以重现该问题:* ![image](https://github.com/alibaba/fastjson2/assets/29773167/ed7e4b34-62c4-4fa6-9c33-9e052f131dc5) ![image](https://github.com/alibaba/fastjson2/assets/29773167/fab1a7a8-21ff-47a9-8956-7f1d8867fdf4) ### 期待的正确结果 *对您期望发生的结果进行清晰简洁的描述。* ![image](https://github.com/alibaba/fastjson2/assets/29773167/5dc84cb4-386e-4a41-bb36-4db10a261b8a)

bug

### 问题描述 *fastjson1.2.83升级到2.0.47,原先序列化引用对象的数据,再进行反序列化报错* ### 环境信息 *请填写以下信息:* - OS信息: [e.g.:Windows10 ] - JDK信息: [e.g.:Openjdk 17] - 版本信息:[e.g.:Fastjson2 2.0.47] ### 重现步骤 1、分别定义1个类(一点要是公共类) ```java package com.metas.hanger.model.valueobject; import com.metas.common.dto.BaseDTO; import lombok.AllArgsConstructor; import lombok.Data; import...

bug

### 问题描述 在`@JSONField`注解中的属性`serializeUsing`中针对`org.springframework.web.multipart.MultipartFile`指定自定义的`ObjectWriter`在调用`JSON.toJSONString()`时没有生效 ### 版本信息 ```xml com.alibaba.fastjson2 fastjson2 2.0.43 ``` ### 重现步骤 首先问题是在序列化`org.springframework.web.multipart.MultipartFile`时出现的, 如果不指定`ObjectWriter`, 则会在调用`JSON.toJSONString()`时出现`Caused by: java.io.FileNotFoundException: D:\temp\work\Tomcat\localhost\ROOT\upload_2ad6d63e_24e3_4352_b778_07bb9100c348_00000000.tmp (系统找不到指定的文件。)`这样的异常, 看样子是序列化时会去尝试获取这个文件/资源(有点疑惑为什么序列化`MultipartFile`时会需要读取文件?), 于是我实现了一个`ObjectWriter`, 并在`@JSONField`注解中的属性`serializeUsing`中指定了它: ```java @Data public class MultipartDto implements Serializable {...

bug

Annotation定义 ```java @Retention(RetentionPolicy.RUNTIME) public @interface JSONCompiled { boolean debug() default false; } ``` * 配置 ```java @JSONCompiled(debug=true) class Bean { public int id; } ``` * 效果 将codegen的代码用java.txt的方式输出,方便看生产代码的逻辑

enhancement

Bumps [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core) from 3.6.5 to 3.6.6. Release notes Sourced from io.projectreactor:reactor-core's releases. v3.6.6 Reactor Core 3.6.6 is part of 2023.0.6 Release Train. What's Changed :sparkles: New features and improvements Bump...

dependencies