Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.83 JSONArray.parseArray(JSONArray.toJSONString(jsonArray),Test.class) ,@JsonProperty无效 #4485

Open
ZOL4789 opened this issue Mar 8, 2024 · 1 comment

Comments

@ZOL4789
Copy link

ZOL4789 commented Mar 8, 2024

// 类
public class Test {
@JsonProperty("isStudent")
private String studentFlag;
// getter setter省略
}

// controller 方法
public void receive(@responsebody JSONArray jsonArray){
List list = JSONArray.parseArray(JSONArray.toJSONString(jsonArray),Test.class) ;
}

// 前端传参

[{
"isStudent":"1"
}]

调试时list里Test的studentFlag字段是null

@ZOL4789
Copy link
Author

ZOL4789 commented Mar 8, 2024

public void receive(@responsebody List<Test> list)
这样是没问题的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant