Skip to content
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

JTE Spring Boot properties aren't in dash casing #382

Closed
mhalbritter opened this issue Sep 27, 2024 · 7 comments · Fixed by #385
Closed

JTE Spring Boot properties aren't in dash casing #382

mhalbritter opened this issue Sep 27, 2024 · 7 comments · Fixed by #385

Comments

@mhalbritter
Copy link

Hello,

i've noticed that the properties in the spring-configuration-metadata.json file are in camel case (e.g. gg.jte.usePrecompiledTemplates).

If you take a look at the metadata included in Spring Boot itself, it's dash cased.

Btw, there's a plugin which automatically creates the metadata files from the property files.

Would you be open to change the properties to dash-casing (e.g. gg.jte.use-precompiled-templates) for better consistency?

@casid
Copy link
Owner

casid commented Sep 28, 2024

Hi @mhalbritter,

thanks for the feedback, and yes I have no stakes in how the spring properties are named and consistency with the Spring Boot conventions makes a lot of sense.

What's the recommended way to make breaking changes like this? For instance, it would be bad if gg.jte.usePrecompiledTemplates wouldn't be applied when users upgrade and don't read the patch notes carefully.

I could think of keeping the old properties and deprecating them for removal and to throw an exception if those are still set? But maybe there is a better way?

@atomfrede, @tschuehly would you be ok with this change, too?

@atomfrede
Copy link
Contributor

Totally fine. We could print a warning for e.g. 1 release and ignore them in the next (or throw an exception)

@tschuehly
Copy link
Contributor

@kelunik
Copy link
Collaborator

kelunik commented Sep 28, 2024

@casid Breaking changes should only be shipped in major releases. We can likely read both versions with the new name having precedence and log a warning if the old name is used? Then drop the old path in the next major.

@mhalbritter
Copy link
Author

mhalbritter commented Sep 30, 2024

I should have mentioned that in the first post, sorry about that. That's no breaking change. Boot itself binds gg.jte.usePrecompiledTemplates the same way as gg.jte.use-precompiled-templates. However, specifying the properties in dash-casing fixes the auto-suggestions from the IDE. So it's only a "cosmetic" change.

But for the reference, if you ever come to the situation where you need to deprecate some properties: There's a deprecation attribute on the properties in the JSON: https://docs.spring.io/spring-boot/specification/configuration-metadata/format.html#appendix.configuration-metadata.format.property

@casid
Copy link
Owner

casid commented Oct 1, 2024

Thanks for the update and clarification @mhalbritter. @tschuehly already made the changes, so this will be part of the next release :-)

@mhalbritter
Copy link
Author

Great! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants