mathewdenis / json-smart

Automatically exported from code.google.com/p/json-smart
0 stars 0 forks source link

BigDecimal serialization is not supported #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. BigDecimal serialization is not supported
2.
3.

What is the expected output? What do you see instead?
blank output

What version of the product are you using? On what operating system?
1.3.1

Please provide any additional information below.
BigDecimal.class should be added to registerWriter as part of Number writer 
registration in init function of JsonWriter class.

Original issue reported on code.google.com by david.dk...@gmail.com on 22 Oct 2014 at 8:55

GoogleCodeExporter commented 9 years ago
please provide a full example with javacode.

Original comment by uriel.chemouni on 5 Nov 2014 at 11:09

GoogleCodeExporter commented 9 years ago
I have added this code in my java class:

// fix json smart missing BigDecimal serializer
JSONValue.defaultWriter.registerWriter(new JsonWriterI<BigDecimal>() {
    public void writeJSONString(BigDecimal value, Appendable out, JSONStyle compression) throws IOException {
    out.append(value.toString());
    }
}, BigDecimal.class);

Original comment by david.dk...@gmail.com on 5 Nov 2014 at 1:03

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by uriel.chemouni on 11 Mar 2015 at 9:04

GoogleCodeExporter commented 9 years ago
it looks like the modification is already in the git repo 
(https://github.com/netplex/json-smart-v2/blob/master/json-smart/src/main/java/n
et/minidev/json/reader/JsonWriter.java#L211) but it is not in 2.1.1 jar from 
maven central (even if the pom version in git is 2.1.1).

Is it because you do not use SNAPSHOT versions in your trunk/master branch?

Original comment by brouilla...@gmail.com on 31 Mar 2015 at 9:42

GoogleCodeExporter commented 9 years ago
I am using 1.3.1 release that I have downloaded from maven.

Original comment by david.dk...@gmail.com on 31 Mar 2015 at 1:17