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
带注释的json反序列化失败 #939
Comments
测试ok,不过一般也不会有注释吧 |
public static void main(String[] args) {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":false/*comment*/" +
"}";
TestUser testUser = JSONObject.parseObject(jsonString, TestUser.class);
System.out.println(testUser);
} 测试不ok |
你这种注释很奇怪哦 |
正常的注释呀,js执行:console.log({"is_stop":true/comment/}.is_stop),正常 |
正则匹配下/星....星/,先去掉注释,再解析json就不会有这样的问题了 |
你是不是 false 后面直接跟着注释
|
对的,我打星号怎么被屏蔽了 |
@lmm1990 可以使用markdown标记。
|
false/comment/ 我要的是单行注释 |
wenshao
added a commit
that referenced
this issue
Dec 20, 2016
This was referenced Mar 12, 2021
Closed
asa1997
pushed a commit
to Be-Secure/fastjson
that referenced
this issue
Feb 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
github星号显示不出来
The text was updated successfully, but these errors were encountered: