jackson-module-scala icon indicating copy to clipboard operation
jackson-module-scala copied to clipboard

Scalas Int type is not handled in the same way as java.lang.Integer

Open longliveenduro opened this issue 12 years ago • 2 comments

Please see http://stackoverflow.com/questions/19379967/strange-deserializing-problems-with-generic-types-using-scala-and-jackson-and-ja for details.

Shouldn't be the scala "primitive types" be auto converted from Strings?

longliveenduro avatar Oct 15 '13 11:10 longliveenduro

As answered on StackOverflow, this is now explained in the FAQ. I'm leaving it open, however, as a placeholder for fixing the issue more permanently.

christophercurrie avatar Oct 16 '13 16:10 christophercurrie

Another solution is having @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) annotation to class data members. It adds metadata to the data member and jackson is able to parse correctly the type.

hagay3 avatar Mar 28 '19 08:03 hagay3