Code Monkey home page Code Monkey logo

Comments (5)

wenshao avatar wenshao commented on May 17, 2024

这个问题的确存在,但这个是否算一个bug呢?

from fastjson.

zhaoyao avatar zhaoyao commented on May 17, 2024

不是很清楚@type 是否是一个合法的键值, 如果规范允许这种key出现, 并且使用其他json库序列化出来这样一个key, 而fastjson无法解析它, 那么应该是一个bug吧.

from fastjson.

wenshao avatar wenshao commented on May 17, 2024

用这个版本试试看:http://code.alibabatech.com/mvn/snapshots/com/alibaba/fastjson/1.1.16-SNAPSHOT,看是否满足你的需求。

from fastjson.

zhaoyao avatar zhaoyao commented on May 17, 2024

可以正常解析了, 但是解析后会把@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.

wenshao avatar wenshao commented on May 17, 2024

已经改好了,请你再测试一下,谢谢支持 :)

from fastjson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.