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

### 问题描述 我在springboot项目中,想通过fastjson2序列化redis的ValueSerializer和HashValueSerializer以下为序列化和反序列化代码 ![image](https://user-images.githubusercontent.com/62325709/184270396-9ecc2bd7-2149-48af-8595-3b4043c2e1c3.png) 我序列化到redis的时候是正常的, 使用JSON.toJSONBytes(T) 值如下 {"attributes":{"java.security.Principal":{"authenticated":true,"authorities":[{"authority":"ROLE_admin"},{"authority":"ROLE_user"}],"details":{"remoteAddress":"127.0.0.1","sessionId":"A945B195F014D0BA4C8F0FA42D228153"},"name":"leon","principal":{"accountNonExpired":true,"accountNonLocked":true,"attributes":{},"authorities":[{"authority":"ROLE_admin"},{"authority":"ROLE_user"}],"credentialsNonExpired":true,"email":"[email protected]","enabled":true,"name":"leon","nickname":"leon","phone":"18137772224","userId":1,"username":"leon"}},"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest":{"additionalParameters":{},"attributes":{},"authorizationRequestUri":"http://127.0.0.1:9000/whale/oauth2/authorize?response_type=code&client_id=web&scope=all&redirect_uri=https://www.baidu.com","authorizationUri":"http://127.0.0.1:9000/whale/oauth2/authorize","clientId":"web","grantType":{"value":"authorization_code"},"redirectUri":"https://www.baidu.com","responseType":{"value":"code"},"scopes":["all"]},"state":"-q2sa200GhpO36UKcZ4BXgx9gxAqudwKg4i4tTYjMLo="},"authorizationGrantType":{"value":"authorization_code"},"id":"10ce34de-b5e3-4e2c-a3ab-73fa0a7bb46d","principalName":"leon","registeredClientId":"web"} 但是我当反序列化的时候就会提示不可以转换 异常信息 java.lang.ClassCastException: com.alibaba.fastjson2.JSONObject cannot be cast to org.springframework.security.oauth2.server.authorization.OAuth2Authorization 目标转换的类 ![image](https://user-images.githubusercontent.com/62325709/184271894-2215e509-1e2e-4b44-a70d-8a85c01eaba1.png) ### 环境信息 以下是我的坐标版本 com.alibaba.fastjson2 fastjson2 2.0.11

bug

原fastjson 1.*版本 JSON.toJSONString() ,JSONObject.toJSONString()等方法对于时间类型默认转成 yyyy-MM-dd hh:mm:ss格式 切换fastjson2.*版本,时间类型转成时间戳

bug

扩展包使用到了javax.servlet.ServletOutputStream类,最新版springboot使用的类jakarta.servlet.ServletOutputStream 包名变化导致不兼容问题。

### 问题描述 *简要描述您碰到的问题。* ### 环境信息 *请填写以下信息:* - 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.12] ### 重现步骤 *如何操作可以重现该问题:* 1. 使用 `com.alibaba.fastjson.JSONObject#getJSONArray` 及`com.alibaba.fastjson.JSON#parseObject(java.lang.String, com.alibaba.fastjson.TypeReference, com.alibaba.fastjson.parser.Feature...)`方法...

bug

存序列化存Redis的时候报错: org.springframework.data.redis.serializer.SerializationException: Could not deserialize: invoke constructor error, public org.springframework.security.core.authority.SimpleGrantedAuthority(java.lang.String) SimpleGrantedAuthority是springsecurity的类,没有默认的无参构造器。但是又没有详细的mixin文档

question

### 问题描述 *简要描述您碰到的问题。* 升级FastJson2之后,在字段有@JSONField(format = "yyyy-MM-dd HH:mm:ss")注解的情况下,ISO 8601时间格式Json串无法正常反序列化 ### 环境信息 *请填写以下信息:* - OS信息: [e.g.:win7 x64] - JDK信息: [e.g.:Openjdk 1.8.0_312] - 版本信息:[e.g.:Fastjson2 2.0.12] ### 重现步骤 *如何操作可以重现该问题:* v1.2.83 ![企业微信截图_16625351623593](https://user-images.githubusercontent.com/18255492/188816208-88427d33-79e8-48c9-b5e5-22b3ed63d522.png) v2.0.12 ![企业微信截图_16625352719055](https://user-images.githubusercontent.com/18255492/188816305-697f0d26-8f35-4336-af43-be4ae78d14f7.png) ```groovy...

bug

Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 9.2 to 10.3.3. Release notes Sourced from checkstyle's releases. checkstyle-10.3.3 https://checkstyle.org/releasenotes.html#Release_10.3.3 checkstyle-10.3.2 https://checkstyle.org/releasenotes.html#Release_10.3.2 Bug fixes: #11736 - MissingJavadocType: Support qualified annotation names #11655 - Update google_checks.xml to...

dependencies

### 请描述您的需求或者改进建议 *对您想要需求或建议的清晰简洁的描述。* 按照一组配置,替换json中的key字段。 比如: 原json { "userName":"john", "userAge":20, "cityName":"beijing" } 替换后的json { "user_name":"john", "user_age":20, "city_name":"beijing" } 需要支持嵌套json和json数组中key的替换 ### 请描述你建议的实现方案 *对您想要需求或建议的实现方案的详细描述。* ### 描述您考虑过的替代方案 *对您考虑过的任何替代解决方案或功能的描述。* #### 附加信息 *如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*

enhancement

### 请描述您的问题 既要使用 WriteClassName,又可以在子对象里使用 Long/Double 类型,请问如何使用?

question

报错:java.lang.UnsupportedOperationException: can't load this type of class file

bug