Project: talendesb
Issue TESB-9347: Update tRESTRequest Component Configuration to let users explicitly choose the supported data formats
At the moment the REST jobs built with the help of ESB/REST components can only support XML and JSON payloads. Optionally, the plain form ("application/x-www-form-urlencoded") on the input only can be supported. The support for different format types can be required. Typical example: upload a binary file or user registration. OAuth flows will need the support for out "application/x-www-form-urlencoded" responses. Etc. The proposal is to update the tRESTRequest Component Configuration to let users explicitly choose the supported data formats. Specifically the following approach is proposed. Two new columns, "Consumes" and "Produces", to be added to the component configuration editor. The user can click on the drop-down list and select one of the following from the easy to understand format descriptions : XML JSON XML or JSON Form Multipart Form with more formats added as required. The code generator will simply convert the selected values to the correct Consumes and or Produces JAX-RS annotations, for example, XML -> @Produces("application/xml") XML or JSON -> @Produces({"application/xml", "application/json") Multipart Form -> @Consumes("multipart/form-data") etc. Note that all the formats from the above list except Multipart Form are already supported. A dedicated JORA for supporting multipart/form-data is to be opened next. Please find attached the following images: formats2.png - showing an updated Configuration Panel mock formatSelection.png - showing a possible Format selection list
Story points: 3