-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Configuration metadata - Improve camelCaseToDash for nicer configuration names #17273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We might be able to revisit #5330 in 2.x since we've rewritten the binder. |
The binder supports this so we should do something so that the metadata generates |
Excellent. Thanks, @mbhave. I wonder what effect a change in the metadata will have on backwards compatibility. For example, if someone has |
We can imagine generating an additional deprecated entry with a replacement that points to the new format. This can be removed in a future release. |
We're cleaning out the issue tracker and closing issues that we've not seen much demand to fix. Feel free to comment with additional justifications if you feel that this one should not have been closed. |
The spring boot auto-configuration via metadata (eg application.properties) can be improved to have a better camelCaseToDash algorithm.
For example at Apache Camel we have a JMS component that has many options, one of them is:
https://github.com/apache/camel/blob/master/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java#L506
Which gets generated as camel-jms-starter Spring Boot JAR with this option name:
We then grab all these SB option names and include them in the online documentation at:
https://github.com/apache/camel/blob/master/components/camel-jms/src/main/docs/jms-component.adoc#spring-boot-auto-configuration
Where you can see the option in the table listed as
Notice how JMSX gets transformed to
-j-m-s-x-
which is a bit ugly, instead it would be nicer if it was-jmsx-
So it would be nicer if the algorithm was improved to output the name as:
Which we have done in our Camel Main (standalone Camel without Spring Boot)
https://github.com/apache/camel/blob/master/examples/camel-example-main-artemis/src/main/resources/META-INF/spring-configuration-metadata.json#L950
We are using this algorithm to do this:
https://github.com/apache/camel/blob/master/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java#L825
Which works with this unit test:
https://github.com/apache/camel/blob/master/core/camel-util/src/test/java/org/apache/camel/util/StringHelperTest.java
PS: I am not sure if there is any logic that would need to be changed as well to support mapping with this new algorithm.
The text was updated successfully, but these errors were encountered: