pkl icon indicating copy to clipboard operation
pkl copied to clipboard

Support for Spring Boot 3 ConstructorBinding annotation

Open namhptran opened this issue 1 year ago • 2 comments

https://github.com/apple/pkl/blob/a28ef856981d44b861eb6a16ab9bdf23adacf604/pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt#L494

Currently Java Code Generator with Spring Boot Configurations generates classes with annotation org.springframework.boot.context.properties.ConstructorBinding.

This was deprecated in Spring Boot 3.0.0 and as of Spring Boot 3.2.0 this has been removed in favour of org.springframework.boot.context.properties.bind.ConstructorBinding.

https://docs.spring.io/spring-boot/docs/3.0.0/api/org/springframework/boot/context/properties/ConstructorBinding.html

namhptran avatar Feb 13 '24 14:02 namhptran

To add, while Spring Boot 2 supports both class level annotation and constructor level annotation, Spring Boot 3 requires Constructor level annotation (which optionally can also be omitted). Currently it adds to the Class with no option for adding to the Constructor instead.

I think there needs to be an option to exclude this annotation if using Spring Boot 3

namhptran avatar Feb 13 '24 14:02 namhptran

Makes sense!

bioball avatar Feb 14 '24 02:02 bioball