papsign / Ktor-OpenAPI-Generator

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

Allow nullable parameters #77

Closed inaiat closed 3 years ago

inaiat commented 3 years ago

Like reported by @msramosjr We need check if the value o parameter is nullable before throw exception.

This fix the Minimal.kt example. So we are able to allow nullable fields, like follow code:

@Path("string/{a}")
    data class StringParam(
        @PathParam("A simple String Param") val a: String,
        @QueryParam("Optional String") val optional: String? // Nullable Types are optional
    )

Thank you.

inaiat commented 3 years ago

I tried to push some fix at night, but you was amazing fast! :D