Comments (5)
这个问题的确存在,但这个是否算一个bug呢?
from fastjson.
不是很清楚@type 是否是一个合法的键值, 如果规范允许这种key出现, 并且使用其他json库序列化出来这样一个key, 而fastjson无法解析它, 那么应该是一个bug吧.
from fastjson.
用这个版本试试看:http://code.alibabatech.com/mvn/snapshots/com/alibaba/fastjson/1.1.16-SNAPSHOT,看是否满足你的需求。
from fastjson.
可以正常解析了, 但是解析后会把@type扔掉
{
"a": "a",
"b": "b",
"c": "c",
"id": 1,
"condition": [
{
"requirement": "5",
"@type": "x.y.z.SomeType"
}
],
"icon": "1.png"
}
读取后就变成了
{
"a": "a",
"b": "b",
"c": "c",
"id": 1,
"condition": [
{
"requirement": "5"
}
],
"icon": "1.png"
}
from fastjson.
已经改好了,请你再测试一下,谢谢支持 :)
from fastjson.
Related Issues (20)
- JSONObject.toJSONString生产必现解析日期丢失HH:mm:ss,只有yyyy/MM/dd且偶现打印日期和实际日期还不一致
- FastJson序列化导致线程数上涨,metaspace使用率上涨,ASMClassLoader动态生成类持有锁,会导致线程阻塞?全局只有一个config为什么会元空间上涨?
- v2.0.14 JSONObject.parseArray()解析16进制的字符串报错 HOT 2
- java.lang.AbstractMethodError: Receiver class com.alibaba.fastjson.support.jaxrs.FastJsonAutoDiscoverable does not define or inherit an implementation of the resolved method 'abstract void configure(jakarta.ws.rs.core.FeatureContext)' of interface org.glassfish.jersey.internal.spi.AutoDiscoverable. HOT 1
- [bug]JSONPath.eval取不到值 HOT 3
- 【安全问题】异常携带了版本信息
- toJSONString传入空对象如何返回null而不是字符串null HOT 2
- alternateNames别名解析失效问题
- IntegerCodec#deserialze中的TypeUtils.castToInt 在value是逗号分隔字符串时,会把逗号去除转成Integer,应该直接报转换异常。 版本:1.2.67
- discard
- infinite loop with specific text
- 是否可以在添加json 反序列化生命周期, 适用于: 其中一个字段依赖于其它几个字段完成之后的结果, 比如: 字段 d: 依赖于 字段:a, b, c 的和或者均值
- enum default value
- @JSONCreator 注解修饰在静态工厂方法上没有达到预期效果
- JSON.parseObject("ok", String.class) 为什么总是报错,是啥原因呢 HOT 3
- JSONWriterUTF16.writeNameRaw 数组扩容未成功导致的数组越界问题未完全解决 HOT 1
- Failing while building fastjson version 1.2.83 using mvn clean install (fastjson1.2.83) HOT 1
- 使用2222.00000数字转换后变成377.
- WriteNullStringAsEmpty和WriteMapNullValue 两个序列化属性不能同时生效
- 从1.2.29升到1.2.83报 can't create non-static inner class instance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastjson.