EsotericSoftware / jsonbeans

Java object graphs, to and from JSON automatically
BSD 3-Clause "New" or "Revised" License
91 stars 30 forks source link

parse json #1

Closed ghost closed 8 years ago

ghost commented 10 years ago

From eoupri...@gmail.com on March 20, 2012 10:24:08

To parse json string to object,if the object have any integer property,will eccour :

Unable to convert value to required type: 31.0 (int)

the reason java.lang.NumberFormatException: For input string: "31.0" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:456)

{numbers:[{type:jery.test.PhoneNumber,name:Home,number:"206-555-1234"},{type:jery.test.PhoneNumber,name:Work,number:"425-555-4321"}],age:31,name:Nate}

Original issue: http://code.google.com/p/jsonbeans/issues/detail?id=1

NathanSweet commented 8 years ago

No idea, this isn't a proper issue.