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

Suggestion about JSONValue.toJSONString #7

Closed
GoogleCodeExporter opened this issue Aug 5, 2015 · 6 comments
Closed

Suggestion about JSONValue.toJSONString #7

GoogleCodeExporter opened this issue Aug 5, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Hello, It would be useful to include 

        if(value instanceof Object[])
            return JSONArray.toJSONString(Arrays.asList((Object[])value));

I hope you can include this two simple lines

Thanks a lot

Original issue reported on code.google.com by bare...@gmail.com on 6 Oct 2009 at 6:01

@GoogleCodeExporter
Copy link
Author

Yes, we were aware that some users may need this kind of convenient array 
support. We
are considering adding it to the future release. Thanks a lot for your 
suggestion.

Original comment by fangyid...@gmail.com on 7 Oct 2009 at 12:30

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Issue 14 has been merged into this issue.

Original comment by fangyid...@gmail.com on 7 Dec 2009 at 5:22

@GoogleCodeExporter
Copy link
Author

json-simple was unable to serialize the result of request.getParameterMap() 
because
it returns Map<String,String[]>. In fact, the result is not even valid JSON. If 
it's
just calling toString(), I would expect it to at least be quoted.

*** Code:
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
  String json = JSONValue.toJSONString(request.getParameterMap());
  doSomethingWith(json);
}

*** Test URL:
/myservlet?test=foo

*** Result:
{"test":[Ljava.lang.String;@2afa2afa}

*** Expected Result:
{"test":["foo"]}

Original comment by jeoffwilks@gmail.com on 10 Feb 2010 at 8:11

@GoogleCodeExporter
Copy link
Author

Issue 28 has been merged into this issue.

Original comment by fangyid...@gmail.com on 14 Jul 2010 at 1:14

@GoogleCodeExporter
Copy link
Author

Looks like the outcome from 
http://code.google.com/p/json-simple/issues/detail?id=48 is pretty similar to 
this, maybe should be merged?

Original comment by michael....@gmail.com on 3 Apr 2012 at 8:07

@GoogleCodeExporter
Copy link
Author

This is done in r211.

Original comment by jon.cham...@gmail.com on 10 Aug 2013 at 2:58

  • Changed state: Fixed

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

1 participant