Skip to content

Commit 1871cff

Browse files
committed
Document that constructor binding does not support @…Unit annotations
Closes gh-22565
1 parent e161718 commit 1871cff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,8 @@ These are:
13411341
* `d` for days
13421342

13431343
The default unit is milliseconds and can be overridden using `@DurationUnit` as illustrated in the sample above.
1344+
Note that `@DurationUnit` is only supported with JavaBean-style property binding using getters and setters.
1345+
It is not supported with constructor binding.
13441346

13451347
TIP: If you are upgrading from a previous version that is using `Long` to express the duration, make sure to define the unit (using `@DurationUnit`) if it isn't milliseconds alongside the switch to `Duration`.
13461348
Doing so gives a transparent upgrade path while supporting a much richer format.

0 commit comments

Comments
 (0)