So it looks, like Blueprint cannot assign the string class name to the 
JsonApiDataFormat property, which is defined as :

 private Class<?>[] dataFormatTypes;
 ...
 public void setDataFormatTypes(Class<?>[] dataFormatTypes) {
        this.dataFormatTypes = dataFormatTypes;
 }

How would you specify an array of classes as required by the data format 
property in Rest DSL restConfiguration  Blueprint XML?

<restConfiguration component=“servlet" jsonDataFormat="jsonApi" 
bindingMode=“json”>
        <dataFormatProperty key="contentTypeHeader" value="false" />
        <dataFormatProperty key="dataFormatTypes" 
value=“ARRAY-OF-CLASSES????????" />
 </restConfiguration>


Best regards,
Alex soto




> On Feb 4, 2020, at 10:58 AM, Alex Soto <alex.s...@envieta.com> wrote:
> 
> Tried this:
> 
> <restConfiguration component=“servlet" jsonDataFormat="jsonApi" 
> bindingMode=“json”>
>       <dataFormatProperty key="contentTypeHeader" value="false" />
>       <dataFormatProperty key="dataFormatTypes" value=“org.my.class.here" />
>  </restConfiguration>
> 
> 
> 
> Produces error:
> 
> Error binding property (dataFormatTypes=org.my.class.here) with name: 
> dataFormatTypes on bean: 
> org.apache.camel.component.jsonapi.JsonApiDataFormat@409e7690 with value: 
> org.my.class.here
> 
> 
> 
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Feb 4, 2020, at 10:34 AM, Alex Soto <alex.s...@envieta.com 
>> <mailto:alex.s...@envieta.com>> wrote:
>> 
>> Hello,
>> 
>> I am trying to use the JSonApi data format with Camel Rest DSL.  There are 
>> not examples, as far as I know. 
>> So I am configuring it like this:
>> 
>> <dataFormats>
>>      <jsonApi contentTypeHeader="false" dataFormatTypes=“org.my.class.here"/>
>> </dataFormats>
>> <restConfiguration 
>>      component="servlet"
>>      bindingMode="json"
>>      jsonDataFormat="jsonApi” 
>> 
>> This is not working, the rest service produces 500 error.  Anybody knows how 
>> to set it up correctly or point me to an example?
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
> 

Reply via email to