Closed
Description
Version: Spring Boot 2.3.2
I have the following simple TestController
.
@RestController
@RequestMapping("/test")
public class TestController {
@Getter
protected static class TestObj {
@DurationUnit(ChronoUnit.MINUTES)
private Duration breakTime;
}
@GetMapping("/test")
public void test(@RequestBody TestObj test) {
System.out.println(test.getBreakTime());
}
}
With the following body...
{
"breakTime" : 30
}
... what I see in the console is
PT30S
Obviously, conversion is not happening. It always default to SECONDS.