Closed inaiat closed 3 years ago
Thanks for your contribution
This should let me handle validation errors differently from other errors with ease. Wondering when this change becomes available as a release, @Wicpar ? Thanks!
oh, right, the release...
This PR apparently broke the optional query param feature. I have run the example in Minimal.kt and when calling /string/{a}
without the optional
query param I got this error:
17:03:28.673 [nioEventLoopGroup-4-3] ERROR ktor.application - Unhandled: GET - /string/123
com.papsign.ktor.openapigen.exceptions.OpenAPIRequiredFieldException: The field optional is required
at com.papsign.ktor.openapigen.parameters.handlers.ModularParameterHandler.parse(ModularParameterHandler.kt:32)
at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$$inlined$apply$lambda$1$1.invokeSuspend(OpenAPIRoute.kt:63)
at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$$inlined$apply$lambda$1$1.invoke(OpenAPIRoute.kt)
The code in Minimal.kt:
@Path("string/{a}")
data class StringParam(
@PathParam("A simple String Param") val a: String,
@QueryParam("Optional String") val optional: String? // Nullable Types are optional
)
My code is similar to this one and also have broken.
right, forgot about this peculiar thing...
see issue 74