November 2018
Intermediate to advanced
388 pages
9h 5m
English
The Jackson plugin is not available with the Kotlin compiler distribution, but it is available as part of the Jackson module. It provides an automatic binding between the parsed JSON data and the constructor arguments of a class. All Kotlin types are supported. We need to specify JsonProperty on the constructor arguments in order to bind the JSON data.
This plugin is useful for mapping JSON data to the members of a class:
data class Person( @param:JsonProperty("firstName") override val firstName: String, @param:JsonProperty("lastName") override val lastName: String ) : Person
Bytecode prior to Java 8 did not contain names for the arguments of the constructor. Frameworks cannot bind the data to the constructor arguments ...
Read now
Unlock full access