-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Document defaults for spring.mvc.format.* and spring.webflux.format.* properties #30041
Comments
There are defaults but they're not expressed in the metadata at the moment. When the properties aren't configured, your app will use the fallbacks provided by Framework's private DateTimeFormatter getFallbackFormatter(Type type) {
switch (type) {
case DATE: return DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
case TIME: return DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT);
default: return DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
}
} Changing the defaults would be a breaking change which we generally try to avoid. It may be possible for us to improve the metadata though. |
Okay, while I feel |
Why are there no default settings for
spring.mvc.format.*
properties?I mean: spring is convention over configuration, but when I send a
POST
request and want spring to parse values like2021-07-19
into ajava.time.LocalDate
orjava.time.LocalDateTime
field, I have to explicit op-in?Please consider setting them to some reasonable values, like:
The text was updated successfully, but these errors were encountered: