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

JSON不支持序列化 #1492

Open
felayman opened this issue Sep 22, 2017 · 2 comments
Open

JSON不支持序列化 #1492

felayman opened this issue Sep 22, 2017 · 2 comments

Comments

@felayman
Copy link

felayman commented Sep 22, 2017

定义的类如下:

public final class DubboResponse implements Serializable{

	private String message;

	private String error;

	private JSON data;

	private boolean success;
} 

初衷是返回的数据既能是JSONObject,也能是JSONArray,然后就是要JSON在这里,现在JSON本身是无法被序列化的

@vipcxj
Copy link

vipcxj commented Sep 23, 2017

其实用Object就好~ 然后用instance of判断JSONObject还是JSONArray

wenshao added a commit that referenced this issue Sep 23, 2017
@wenshao
Copy link
Member

wenshao commented Sep 23, 2017

补充了testcase,没发现问题

kimmking added a commit to kimmking/fastjson that referenced this issue Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants