val event = Json.parse(CloudWatch.serializer(), jsonRequest)
And then throw
2020-08-18 12:45:37.138 ERROR LambdaHandler:57 - Error occurred during handle of request and was not caught
kotlinx.serialization.MissingFieldException: Field 'source' is required, but it was missing
at io.kotless.dsl.model.CloudWatch.<init>(CloudWatch.kt)
at io.kotless.dsl.model.CloudWatch$$serializer.deserialize(CloudWatch.kt)
at io.kotless.dsl.model.CloudWatch$$serializer.deserialize(CloudWatch.kt:7)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:34)
at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:33)
at kotlinx.serialization.CoreKt.decode(Core.kt:80)
at kotlinx.serialization.json.Json.parse(Json.kt:126)
at io.kotless.dsl.LambdaHandler.handleRequest(LambdaHandler.kt:66)
at io.kotless.local.handler.DynamicHandler.handle(DynamicHandler.kt:45)
Perhaps at least wrap the deserialization? So it can continue to process the HTTP Event?
Currently in https://github.com/JetBrains/kotless/blob/master/dsl/kotless/lang/src/main/kotlin/io/kotless/dsl/LambdaHandler.kt#L43 it uses a raw JSON String check to determine the type of CloudWatch Event. However for example if I created a POST request with body
This will try to deserialize as CW event
And then throw
Perhaps at least wrap the deserialization? So it can continue to process the HTTP Event?