Description
Sébastien Deleuze opened SPR-15673 and commented
Following the work done on #19763, it seems we don't support currently Kotlin classes with default parameters since the bytecode generated contains 2 constructors.
This comment from Jayson Minard provide useful guidance. We could maybe take inspiration of https://github.com/FasterXML/jackson-module-kotlin/ that implements similar support.
This feature should if possible be reusable from Spring Boot for its support for @ConfigurationProperties
and Spring Data which currently requires Kotlin noarg compiler plugin (I have validated it is currently required via MiXiT application, would be nice to be able to avoid using this plugin which is basicaly a trick for libraries without Kotlin support).
Juergen Hoeller I am going to try to write Kotlin tests that demonstrate the issue and try to find the right Kotlin API to use for that, I may need your guidance for the steps after that.
Issue Links:
- Data binding with immutable objects (Kotlin / Lombok / @ConstructorProperties) [SPR-15199] #19763 Data binding with immutable objects (Kotlin / Lombok /
@ConstructorProperties
) - Kotlin bean instantiation regression with default declared constructor [SPR-15851] #20406 Kotlin bean instantiation regression with default declared constructor
- BindingResult support for constructor argument mismatch on immutable data object [SPR-15542] #20101 BindingResult support for constructor argument mismatch on immutable data object
- Revisit handling of missing fields (without default values) for immutable data classes [SPR-15877] #20432 Revisit handling of missing fields (without default values) for immutable data classes
- Streamline and reduce Kotlin delegates [SPR-16020] #20569 Streamline and reduce Kotlin delegates
Referenced from: commits d8e52c0, fa4d139, ab64305, 3991ab4, 40df7b6