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

[QUESTION] JSONPObject这个是不支持了吗?返回JSONP之后,参数都被序列化了,请问这个该如何设置呢 #1493

Closed
qingqingdaxia opened this issue May 18, 2023 · 6 comments
Labels
bug Something isn't working fixed question Further information is requested
Milestone

Comments

@qingqingdaxia
Copy link

请描述您的问题

询问有关本项目的使用和其他方面的相关问题。
JSONPObject找不到了,这个是不支持了吗?

@qingqingdaxia qingqingdaxia added the question Further information is requested label May 18, 2023
@qingqingdaxia qingqingdaxia changed the title [QUESTION] JSONPObject找不到了,这个是不支持了吗? [QUESTION] JSONPObject找不到了,这个是不支持了吗?返回JSONP之后,被序列化,请问这个该如何设置呢 May 18, 2023
@qingqingdaxia
Copy link
Author

JSONPObject jsonp = new JSONPObject(callBack,data);
JsonGenerator gen = new JsonGenerator();
try {
jsonp.serializeWithType(gen, null, null);
} catch (IOException e) {
throw new RuntimeException(e);
}

        String str = gen.getJSONWriter().toString();
        return jsonp;

接口返回的时候都给序列化了{
"function": "abc",
"value": {
"code": "0000"}}

@qingqingdaxia
Copy link
Author

图片
以前fastjson1有这个jsonp的判断的,fastjson2没找到这个判断

@qingqingdaxia qingqingdaxia changed the title [QUESTION] JSONPObject找不到了,这个是不支持了吗?返回JSONP之后,被序列化,请问这个该如何设置呢 [FEATURE] JSONPObject这个是不支持了吗?返回JSONP之后,参数都被序列化了,请问这个该如何设置呢 May 18, 2023
@qingqingdaxia qingqingdaxia changed the title [FEATURE] JSONPObject这个是不支持了吗?返回JSONP之后,参数都被序列化了,请问这个该如何设置呢 [QUESTION] JSONPObject这个是不支持了吗?返回JSONP之后,参数都被序列化了,请问这个该如何设置呢 May 18, 2023
@wenshao wenshao added the bug Something isn't working label May 18, 2023
@qingqingdaxia
Copy link
Author

qingqingdaxia commented May 19, 2023

@wenshao 大神,我看你改成bug了,请问一下,这个JSONP的返回判断会添加到FastJsonHttpMessageConverter里面吗?

@wenshao wenshao added this to the 2.0.33 milestone May 20, 2023
@wenshao
Copy link
Member

wenshao commented May 20, 2023

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson/2.0.33-SNAPSHOT/
问题已修复,请帮忙用2.0.33-SNAPSHOT版本验证。

wenshao added a commit that referenced this issue May 20, 2023
@wenshao wenshao added the fixed label May 20, 2023
@qingqingdaxia
Copy link
Author

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson/2.0.33-SNAPSHOT/ 问题已修复,请帮忙用2.0.33-SNAPSHOT版本验证。

@wenshao 收到!我下周验证一下.验证结果出来了,及时同步到这里.麻烦了,谢谢

@qingqingdaxia
Copy link
Author

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson/2.0.33-SNAPSHOT/ 问题已修复,请帮忙用2.0.33-SNAPSHOT版本验证。

@wenshao 收到!我下周验证一下.验证结果出来了,及时同步到这里.麻烦了,谢谢

@wenshao 已测试,返回JSONP参数正常了,谢谢.期待release版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants