You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the exception of POJO getters JStachio uses the exact name to find bindings (variables/sections).
Thus if you want a variable named in kebab style like "inner-message" which is not a valid Java identifier you cannot do it.
This is a problem for folks coming from JSON based models where a such a naming style is more typical.
An obvious solution would be to offer an annotation that you can put on a field or method similar to Jackson's @JsonProperty this seems rather laborious and in some cases a model cannot be annotated.
So careful design considerations need to be made and more feedback.
If you would like to see some solution to this problem please thumb-up!
The text was updated successfully, but these errors were encountered:
I have some hesitations that I can't really formulate yet into words about defaulting to converting kebab-case to camelCase.
Partly because kebab-case just happens to not be a valid Java identifier so it happens to be one of the only naming conventions that will work. Also I think it is the least likely used and probably what people will want is snake_case particularly if they have some JSON REST API where they have chosen snake_case.
I will wait to see someone complain about it some more to figure out use cases.
With the exception of POJO getters JStachio uses the exact name to find bindings (variables/sections).
Thus if you want a variable named in kebab style like "
inner-message
" which is not a valid Java identifier you cannot do it.This is a problem for folks coming from JSON based models where a such a naming style is more typical.
An obvious solution would be to offer an annotation that you can put on a field or method similar to Jackson's
@JsonProperty
this seems rather laborious and in some cases a model cannot be annotated.So careful design considerations need to be made and more feedback.
If you would like to see some solution to this problem please thumb-up!
The text was updated successfully, but these errors were encountered: