papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
244 stars 42 forks source link

add java.util.Optional support #103

Closed ITurchenko closed 3 years ago

ITurchenko commented 3 years ago

Allow usage Optional<T>? in @QueryParam

data class OptionalRequest(
    @QueryParam("strictly optional", allowEmptyValues = true) val optInt: Optional<Int>? = null
)

Result /request?optInt=1 > Optional.of(1) /request?optInt= > Optional.empty() /request?optInt=null > Optional.empty() /request > null