Giter Site home page Giter Site logo

对于变量名类似为pId类的变量,用33版本的fastjson转换后会变成PId,用23版本的fastjson正常 about fastjson HOT 10 CLOSED

alibaba avatar alibaba commented on May 3, 2024
对于变量名类似为pId类的变量,用33版本的fastjson转换后会变成PId,用23版本的fastjson正常

from fastjson.

Comments (10)

rill avatar rill commented on May 3, 2024

33版本测试结果:
{"PId":"aa","UName":"abc","t_id":"2"}
23版本测试结果:
{"pId":"aa","uName":"abc","t_id":"2"}

from fastjson.

wenshao avatar wenshao commented on May 3, 2024

PId比pId更好吧?

from fastjson.

rill avatar rill commented on May 3, 2024

这样不太合理吧,不应该改名吧。
主要是生成json格式的数据供前端的ztree用,ztree.js里定义的变量是pId,两边就对不起来了。
一升级,树都华丽丽的显示异常了。

from fastjson.

rill avatar rill commented on May 3, 2024

加了@JSONField(name = "pId")也无用,建议还是做成可配置的,别限制死吧

from fastjson.

wenshao avatar wenshao commented on May 3, 2024

加了@JSONField应该有用的,你是怎么用的?

from fastjson.

wenshao avatar wenshao commented on May 3, 2024

问题已经修复。

from fastjson.

wenshao avatar wenshao commented on May 3, 2024

http://repo1.maven.org/maven2/com/alibaba/fastjson/1.1.34/

from fastjson.

rill avatar rill commented on May 3, 2024

赞一下温少的处理速度

from fastjson.

yanyinxi avatar yanyinxi commented on May 3, 2024

public class RestResHeaderDomain {

private String method;

@JSONField(name = "Ver")
private String Ver;

public static void main(String[] args) {
//com.alibaba.fastjson.util.TypeUtils.compatibleWithJavaBean = true;
String str= JSON.toJSONString(new RestResHeaderDomain());

    System.out.println(str);
}

结果:
{"ver":"2.0"}

不知道这个怎么用啊?
com.alibaba.fastjson.util.TypeUtils.compatibleWithJavaBean = true;

from fastjson.

yanyinxi avatar yanyinxi commented on May 3, 2024

@wenshao

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.