Re: [json-lib-user] Have JSON values as something other than strings
Brought to you by:
aalmiray
From: Andres A. <aal...@ya...> - 2008-08-06 17:43:30
|
Hi Peter, Json-lib should honor numbers and booleans, if it is rendering them as strings there is probably something wrong. Could you share your test code? also which version are you testing with? Arbitrary javascript code is not allowed, i.e. {“dateLong”: new Date(123456789)} due to the JSON spec Cheers, Andres ------------------------------------------- http://jroller.com/aalmiray http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are 10 types of people in the world: Those who understand binary, and those who don't. To understand recursion, we must first understand recursion. ----- Original Message ---- From: Peter Wilkinson <Pet...@ig...> To: jso...@li... Sent: Wednesday, August 6, 2008 9:35:20 AM Subject: [json-lib-user] Have JSON values as something other than strings Hi all, I’m new to playing with json-lib but it looks pretty handy. One query though. I’ve noticed that if I have an object with Booleans, numbers and strings the json that comes out only contains strings. e.g. int i = 3; boolean bool = false; long dateLong = 123456786; String str = “str”; goes to {“i” : “3”, “bool” : “false”, “dateLong”: “123456789”, “str” : “str”} Is it possible to make it give me {“i” : 3, “bool” : false, “dateLong”: new Date(123456789) , “str” : “str”}} Cheers, Peter The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059. |