Skip to content

Support for specifying defaultValue using Kotlin's default value #3009

Closed
@sivaprasadreddy

Description

@sivaprasadreddy

With Spring Boot + Kotlin, I can specify a default value for a request parameter in 2 ways:

//Using defaultValue attribute
fun getAll(@RequestParam(defaultValue = 1) page: Int) = ...

//Using Kotlin's default method argument value features
fun getAll(@RequestParam page: Int = 1) = ...

Both of these approaches works fine.
However, when the Open API docs are generated, the default value is showing up correctly only when getAll(@RequestParam(defaultValue = 1) page: Int) syntax is used, but not for getAll(@RequestParam page: Int = 1).

Please support generating the Swagger docs with default value when Kotlin's default value assignment syntax is used as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions