automatic

The annotation processor will try to find the best way to decode the @Json-annotated class using the following approaches, in order:

  1. none for any object

  2. the constructor annotated with @Json.Constructor if present

  3. the primary constructor if present, accessible and not annotated with @Json.Excluded

  4. a secondary constructor if there is only one accessible and not annotated with @Json.Excluded

Accessible in this case means having internal or public visibility.

Note that an error will be raised if

  • multiple secondary constructors could be used and there is no primary constructor

  • the constructor which would be chosen uses vararg

  • none of the approaches can be used to create an instance of the class

Properties

Link copied to clipboard
Link copied to clipboard