Comments (11)
Looks sane to me too. Blindly returning result of value.toString() is a bug
IMO. Any way to produce valid JSON is much better than this. Either escape it
like suggested or return null or "undefined" or whatever.
Original comment by [email protected]
on 14 Jul 2010 at 12:03
from json-simple.
Original comment by [email protected]
on 14 Jul 2010 at 1:10
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from json-simple.
Issue 18 has been merged into this issue.
Original comment by [email protected]
on 14 Jul 2010 at 1:15
from json-simple.
Oops, i didn't notice this one, i'm sorry, issue #33 is a duplicate :_(
Anyway, the problem seems to affect writeJSONString as well.
Here's a small patch that seems to work for me...
bye.
Original comment by [email protected]
on 4 Aug 2010 at 9:11
Attachments:
from json-simple.
Issue 33 has been merged into this issue.
Original comment by [email protected]
on 5 Aug 2010 at 12:15
from json-simple.
hello. I just wanted to ask, if there will be a next version of the json-simple
library with this enhancement in the near future.
Original comment by [email protected]
on 21 Feb 2011 at 10:44
from json-simple.
Not sure what does "near future" mean to you, but I do have a plan making some
improvement of json-simple this year. Will let your guys know once I have any
update.
Thanks,
Yidong.
Original comment by [email protected]
on 22 Feb 2011 at 4:49
from json-simple.
thanks for the info. The library works also very well in our project, but now
we are facing the problem that "java.util.Date" classes are not serialized with
the "", so we get something like this in our json strings:
"birthdate" : Thu Jul 01 00:00:00 CET 1976
But we need something like this, so we can deserialize the date again:
"birthdate" : "Thu Jul 01 00:00:00 CET 1976"
The patch provided here seems to work, but it would be better if the official
json-simple lib provides this feature/enhancement.
Maybe there is also an other way to format a java.util.date correctly, without
applying this patch ?
Original comment by [email protected]
on 24 Feb 2011 at 9:28
from json-simple.
To make it work without modifying anything in json-simple, you may want to call
toString() of java.util.Date before putting it in a java.util.Map:
json.put("key", aDate.toString())
Thanks,
Yidong.
Original comment by [email protected]
on 24 Feb 2011 at 11:22
from json-simple.
thanks, this seems like a good alternative.
B.Huber
Original comment by [email protected]
on 25 Feb 2011 at 12:46
from json-simple.
Original comment by [email protected]
on 10 Aug 2013 at 4:59
- Changed state: Duplicate
from json-simple.
Related Issues (20)
- escaped backslash results in new line character if followed by 'n' or 'r' HOT 1
- JSONParser.parse() throws a parse exception on trailing and leading whitespace of a JSON String. HOT 1
- Make junit's scope to test HOT 3
- Build JSONArray from a Collection HOT 1
- StringBuilder and StringBuffer values are unquoted HOT 1
- I need to modify JSON object value at run time.
- Move project to Github HOT 2
- A wrapper for converting A Java HashMap<Object, Object> containing Arrays to a correctly represented JSONObject HOT 1
- JSONParser.parse not working for UTF-8 encoded file HOT 4
- linkedHashMap does not preserve order once data has reached client
- Please provide a source archive for release 1.1.1
- MAVEN, json-simple 1.1.1 depends on Junit HOT 3
- bug in get(), ContainerFactory HOT 1
- JSONObject produces warning in code HOT 6
- Long cast error, even if String used HOT 2
- Patch for /trunk/src/main/java/org/json/simple/parser/ContainerFactory.java HOT 2
- nothing is being converted to a JSONObject in my java class, throwing an exception HOT 1
- Building 1.1.1 with java-1.8.0 tests fail - hash not matching? HOT 2
- Functions are missing from json_simple.jar (1.1)
- should not always use toString() as fallback in JSONValue.writeJSONString() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-simple.