Search code examples
javajsongwtautobean

How to deserialize BigDecimal by using GWT AutoBean?


I have json coming from server and representing pojos. When i deserialize to json using AutoBean some works some dont! I figure out that those which cant be deserialize has BigDecimal getters/setters.

Error:

TypeError: Cannot read property 'length' of undefined at java_math_BigDecimal_$initFrom__Ljava_math_BigDecimal_2Ljava_lang_String_2

How to handle BigDecimal into GWT while deserializing with AutoBean?

ps:

the nested question is this one


Solution

  • AutoBean expects BigDecimal as strings in the JSON payload.

    We discussed it at http://gwt-code-reviews.appspot.com/1601805/
    Feel free to file an issue though, the decision was not a "no" but rather a "not now".