KumologicaHQ / kumologica-support

3 stars 0 forks source link

Payload parsed as String : POST Event listener #23

Open sharmmoh1983 opened 3 years ago

sharmmoh1983 commented 3 years ago

Team

We have observed that POST Event listener Payload always get parsed as String and we have to use JSON Convertor node in flow to convert to Json Object.

Is it possible to define type of object at Event Listener Node ? image

ab73863 commented 3 years ago

@sharmmoh1983 Have you used the test tab of designer or any REST client like POSTMAN to submit the request ?

Are you trying to access any field under the payload without use of JSON node ?

sharmmoh1983 commented 3 years ago

yes i am using Test tab and accessing field without JSON

jteso commented 3 years ago

@sharmmoh1983 - thanks for your message. When designing a node we always try to get a good balance between practicality and reusability. That reusability is achieved by following the principle of single-responsability. An EventListener node is equivalent to a route in a traditional express application, hence we don't think it is the right place to overload it with extra functionality like body transformation, security checks, etc. and the corresponding error handling for those operations.

For this reason, we will not implement this feature right now, but happy to review it in the future depending on feedback.

sharmmoh1983 commented 3 years ago

So Default data type for Event Listener is String