Project: talendesb
Issue TESB-8402: Get tRESTResponse schema accepting more types
User has asked how to use tRESTResponse to return PDF from a database. At the moment tRESTResponse supports only Document and String thus returning the binary data (as byte[] or Object) will not work. Proposal: update tRESTResponse schema to allow Object and possibly byte[]. Note, the generated methods will have @Produces("application/xml", "application/json" and "text/plain") output media types supported. However, according to the JAX-RS spec, if JAX-RS Response has a custom media type set then this type will be preferred to the one declared in @Consumes. Thus, if the user will use Object or byte[] response type, and set response Content-Type manually in tRESTResponse/AdvancedProperties/HTTP Headers, example to "application/pdf", then it will work very well at CXF level. So, simply allowing tRESTResponse accepting Object and/or byte[] will be all what is needed (at this stage) to let users return binary data too
Story points: 2