Allows using default parameter values for any method parameters resolved
via AbstractNamedValueMethodArgumentResolver
, similar to defaultValue
parameter of e.g. @RequestParam
annotation, but skipping the converter
chain.
Issues: SPR-16598.
Comment From: diesieben07
Rebased onto current master and resolved merge conflicts.
Comment From: raderio
An ETA when it can be merged?
Comment From: raderio
is something wrong with this pull request?
Comment From: snicoll
@raderio please be patient, we'll get to it as soon as we can.
Comment From: sdeleuze
Current Kotlin API forces us to have a rather involved implementation which is not a good fit with our infra. We would need a reflection API that allows Spring to know an optional parameter default value without calling the function. I will discuss with Kotlin team to see what is possible here in Kotlin 1.3.
Comment From: diesieben07
I am not sure if what you want is possible.
You can write something like this:
fun foo(a: String, b: String = a)
or, even worse:
fun foo(a: String, b: String = someFunctionWithSideEffects())
This is impossible to represent in the way you propose.