camunda / connectors

Camunda Connectors
https://docs.camunda.io/docs/components/integration-framework/connectors/out-of-the-box-connectors/available-connectors-overview/
Apache License 2.0
34 stars 36 forks source link

feature-2774 webhook connector can now handle json array in request body #2803

Open mathias-vandaele opened 1 week ago

mathias-vandaele commented 1 week ago

Description

The function which was handling the deserialization of the body from in incoming request could only create a map, if a array of primitive or object was passed, an exception was raised.

This function was called in many places, and something would be casted into a Map<String, Object> Sometime into an Object

In order to manage current and future feature. I created 3 wrapping classes that all hold the body in its different forms:

They all Implement the RawWebHookBody that holds all the methods that can interact with the body

Related issues

closes https://github.com/camunda/connectors/issues/2774

sbuettner commented 1 week ago

@mathias-vandaele Thanks for tackling this. I think we can solve is issue in potentially simpler way. The expected type of the MappedHttpRequest.body property is Object. We can therefore simply map the incoming request body to Object via Jackson without any custom serialization.

mathias-vandaele commented 1 week ago

@mathias-vandaele Thanks for tackling this. I think we can solve is issue in potentially simpler way. The expected type of the MappedHttpRequest.body property is Object. We can therefore simply map the incoming request body to Object via Jackson without any custom serialization.

@sbuettner I made a way simpler solution :D