Closed
Description
Take Weiland opened SPR-16598 and commented
Support specifying defaults for e.g. @RequestMapping
via Kotlin parameter default values like so:
@GetMapping
fun get(@RequestParam limit: Int = 20)
Such a method should behave equivalent to @RequestMapping
with defaultValue
, except that the value does not need to be processed by converters, etc.
This can be implemented in org.springframework.web.method.support.InvocableHandlerMethod
using Kotlin Reflection (KCallable#callBy
), which allows omitting parameters with default values.
Affects: 5.0.4
Referenced from: pull request #1741
2 votes, 5 watchers