Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with spring boot 2.x kebab-case format

In reference to below issue https://github.com/watson-developer-cloud/spring-boot-starter/issues/7 . we have to change prefix to kebab-case in java files. But what if one of the dependency jar files references to a prefix in a format like @ConfigurationProperties(prefix="MY_CONFIG"). Is there a solution to this problem ?

like image 584
user2857397 Avatar asked Jan 28 '23 11:01

user2857397


1 Answers

Is there a solution to this problem ?

I assume you're using Spring Boot 2.x. It tightened up some of the rules around relaxed binding such that the use of the canonical form (kebab-case) is now required in the prefix on @ConfigurationProperties. (Camel case, snake case, and kebab case are all still supported in application.properties files).

The only solution is to update all @ConfigurationProperties annotations to meet Spring Boot 2.0's requirements. In this case that'll require a change to your dependency jar. Note that a @ConfigurationProperties annotation with a prefix in kebab-case will work with both Spring Boot 1.x and 2.x so you should not encounter any backwards compatibility problems with the change.

like image 86
Andy Wilkinson Avatar answered Jan 31 '23 09:01

Andy Wilkinson