Hi Kanishka,

It would be helpful if you can share the payload factory configuration. The
scenario works fine according to the below configuration.

<api xmlns="http://ws.apache.org/ns/synapse"; name="arrayCheck"
context="/check1">
   <resource methods="POST">
      <inSequence>
         <payloadFactory media-type="json">
            <format>               {"outerbody" : $1}            </format>
            <args>
               <arg evaluator="json" expression="$"/>
            </args>
         </payloadFactory>
         <respond/>
      </inSequence>
   </resource>
</api>

Regards,
Arunan

On Wed, Apr 24, 2019 at 9:27 AM Kanishka Gunathilaka <kanis...@villvay.com>
wrote:

> Hi All,
>
> When I try to pass single item only array through payloadfactory or
> datamapper mediator it returns me array as an object.
>
> For example I am expecting following result.
> { “entity” :
>   [ { “attr1” : “value”, “attr2” : “another value”}
>   ]
> }
>
> But I am getting this response.
> { “entity” :
>   { “attr1” : “value”, “attr2” : “another value”}
> }
>
> Could you please explain me how I can overcome this issue?
>
> Thank you,
> Kanishka
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
*Sugunakumar Arunan*
Software Engineer | WSO2

Email : aru...@wso2.com
Mobile : +94766016272
Web : http://wso2.com
<https://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to