You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Matt Sicker <bo...@gmail.com> on 2016/02/18 21:45:51 UTC

Is there a way to selectively disable data binding in a rest-dsl route?

Most of my routes return json, but I now have a new route that needs to
return binary data. This automatically gets marshalled into json due to
using the json binding mode. Is there a way to selectively disable this
feature?

I was thinking of implementing a processor that handles the marshalling of
the response, but this won't handle the unmarshal of the request (which has
the class name specified in the swagger model).

-- 
Matt Sicker <bo...@gmail.com>

Re: Is there a way to selectively disable data binding in a rest-dsl route?

Posted by Matt Sicker <bo...@gmail.com>.
Thanks Claus!

On 19 February 2016 at 12:11, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Ah yeah we should support that. I logged a ticket
> https://issues.apache.org/jira/browse/CAMEL-9625
>
> On Fri, Feb 19, 2016 at 6:01 PM, Matt Sicker <bo...@gmail.com> wrote:
> > I tried doing that and it still marshals the output (which is a
> > ByteArrayInputStream object) into a base64-encoded version of the stream
> > surrounded by double quotes.
> >
> > On 19 February 2016 at 10:21, Matt Sicker <bo...@gmail.com> wrote:
> >
> >> So I could just specify in.setHeader(Exchange.CONTENT_TYPE,
> >> "application/vnd.apple.pkpass") and it won't get marshalled?
> >>
> >> On 19 February 2016 at 00:45, Claus Ibsen <cl...@gmail.com>
> wrote:
> >>
> >>> Set a different content-type as binary is not json then.
> >>>
> >>> On Thu, Feb 18, 2016 at 9:45 PM, Matt Sicker <bo...@gmail.com> wrote:
> >>> > Most of my routes return json, but I now have a new route that needs
> to
> >>> > return binary data. This automatically gets marshalled into json due
> to
> >>> > using the json binding mode. Is there a way to selectively disable
> this
> >>> > feature?
> >>> >
> >>> > I was thinking of implementing a processor that handles the
> marshalling
> >>> of
> >>> > the response, but this won't handle the unmarshal of the request
> (which
> >>> has
> >>> > the class name specified in the swagger model).
> >>> >
> >>> > --
> >>> > Matt Sicker <bo...@gmail.com>
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> http://davsclaus.com @davsclaus
> >>> Camel in Action 2: https://www.manning.com/ibsen2
> >>>
> >>
> >>
> >>
> >> --
> >> Matt Sicker <bo...@gmail.com>
> >>
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Is there a way to selectively disable data binding in a rest-dsl route?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah yeah we should support that. I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-9625

On Fri, Feb 19, 2016 at 6:01 PM, Matt Sicker <bo...@gmail.com> wrote:
> I tried doing that and it still marshals the output (which is a
> ByteArrayInputStream object) into a base64-encoded version of the stream
> surrounded by double quotes.
>
> On 19 February 2016 at 10:21, Matt Sicker <bo...@gmail.com> wrote:
>
>> So I could just specify in.setHeader(Exchange.CONTENT_TYPE,
>> "application/vnd.apple.pkpass") and it won't get marshalled?
>>
>> On 19 February 2016 at 00:45, Claus Ibsen <cl...@gmail.com> wrote:
>>
>>> Set a different content-type as binary is not json then.
>>>
>>> On Thu, Feb 18, 2016 at 9:45 PM, Matt Sicker <bo...@gmail.com> wrote:
>>> > Most of my routes return json, but I now have a new route that needs to
>>> > return binary data. This automatically gets marshalled into json due to
>>> > using the json binding mode. Is there a way to selectively disable this
>>> > feature?
>>> >
>>> > I was thinking of implementing a processor that handles the marshalling
>>> of
>>> > the response, but this won't handle the unmarshal of the request (which
>>> has
>>> > the class name specified in the swagger model).
>>> >
>>> > --
>>> > Matt Sicker <bo...@gmail.com>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Is there a way to selectively disable data binding in a rest-dsl route?

Posted by Matt Sicker <bo...@gmail.com>.
I tried doing that and it still marshals the output (which is a
ByteArrayInputStream object) into a base64-encoded version of the stream
surrounded by double quotes.

On 19 February 2016 at 10:21, Matt Sicker <bo...@gmail.com> wrote:

> So I could just specify in.setHeader(Exchange.CONTENT_TYPE,
> "application/vnd.apple.pkpass") and it won't get marshalled?
>
> On 19 February 2016 at 00:45, Claus Ibsen <cl...@gmail.com> wrote:
>
>> Set a different content-type as binary is not json then.
>>
>> On Thu, Feb 18, 2016 at 9:45 PM, Matt Sicker <bo...@gmail.com> wrote:
>> > Most of my routes return json, but I now have a new route that needs to
>> > return binary data. This automatically gets marshalled into json due to
>> > using the json binding mode. Is there a way to selectively disable this
>> > feature?
>> >
>> > I was thinking of implementing a processor that handles the marshalling
>> of
>> > the response, but this won't handle the unmarshal of the request (which
>> has
>> > the class name specified in the swagger model).
>> >
>> > --
>> > Matt Sicker <bo...@gmail.com>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Is there a way to selectively disable data binding in a rest-dsl route?

Posted by Matt Sicker <bo...@gmail.com>.
So I could just specify in.setHeader(Exchange.CONTENT_TYPE,
"application/vnd.apple.pkpass") and it won't get marshalled?

On 19 February 2016 at 00:45, Claus Ibsen <cl...@gmail.com> wrote:

> Set a different content-type as binary is not json then.
>
> On Thu, Feb 18, 2016 at 9:45 PM, Matt Sicker <bo...@gmail.com> wrote:
> > Most of my routes return json, but I now have a new route that needs to
> > return binary data. This automatically gets marshalled into json due to
> > using the json binding mode. Is there a way to selectively disable this
> > feature?
> >
> > I was thinking of implementing a processor that handles the marshalling
> of
> > the response, but this won't handle the unmarshal of the request (which
> has
> > the class name specified in the swagger model).
> >
> > --
> > Matt Sicker <bo...@gmail.com>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Is there a way to selectively disable data binding in a rest-dsl route?

Posted by Claus Ibsen <cl...@gmail.com>.
Set a different content-type as binary is not json then.

On Thu, Feb 18, 2016 at 9:45 PM, Matt Sicker <bo...@gmail.com> wrote:
> Most of my routes return json, but I now have a new route that needs to
> return binary data. This automatically gets marshalled into json due to
> using the json binding mode. Is there a way to selectively disable this
> feature?
>
> I was thinking of implementing a processor that handles the marshalling of
> the response, but this won't handle the unmarshal of the request (which has
> the class name specified in the swagger model).
>
> --
> Matt Sicker <bo...@gmail.com>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2