-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: enhancementA general enhancementA general enhancement
Milestone
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
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: enhancementA general enhancementA general enhancement