Hi Naasheer Ali,

How you're creating this json ?

If you're creating this json from a POJO class, I think you can't delete
the field as you want. Because you have define those variables inside the
POJO.

Thanks,
Iqbal


On Tue, Dec 9, 2014 at 10:43 AM, Naasheer Ali <[email protected]> wrote:

> Hi All,
>      I'm doing YouTube connector for ESB. Below I've written a JSON
> payload to send a request to ESB, Most of them are optional parameters. I
> need to selectively delete a parameter from the payload when the value of
> the parameter is not assigned to it.
> Say, If I didn't give any value to brandingSettings.channel.description,
> description should be deleted from the payload and others should be there
> as it is and I wanna delete a parameter from the array say,
> brandingSettings.image.backgroundImageUrl.localized.language, How can I
> delete it?.
>
>
>  {
>                     "id":" ",
>                     "brandingSettings":
>                     {
>                         "channel":
>                         {
>                             "description":" ",
>                             "keywords":" ",
>                             "defaultTab":" ",
>                             "trackingAnalyticsAccountId":" ",
>                             "moderateComments":" ",
>                             "profileColor":" ",
>                             "showRelatedChannels":"  ",
>                             "showBrowseView":"  ",
>                             "featuredChannelsTitle":"  ",
>                             "featuredChannelsUrls":"  ",
>                             "unsubscribedTrailer":"  "
>                         },
>                         "image":
>                         {
>                             "backgroundImageUrl":
>                             {
>                                 "default":"  ",
>                                 "localized":
>                                 [
>                                     {
>                                         "language":"  ",
>                                         "value":"  "
>                                     }
>                                 ]
>                             },
>                             "bannerExternalUrl":"  "
>                         }
>                     },
>                     "invideoPromotion":
>                     {
>                         "position":
>                         {
>                             "cornerPosition":"  ",
>                             "type":"   "
>                         },
>                         "defaultTiming":
>                         {
>                             "type":"  ",
>                             "offsetMs":"  "
>                         },
>                         "items":
>                         [
>                             {
>                                 "id":
>                                 {
>                                     "type":"   ",
>                                     "videoId":"   ",
>                                     "websiteUrl":"  "
>                                 },
>                                 "timing":
>                                 {
>                                     "type":"   ",
>                                     "offsetMs":"   "
>                                 },
>                                 "customMessage":"   ",
>                                 "promotedByContentOwner":"   "
>                             }
>                         ]
>                     }
>                 }
>
> Regards,
> --
>
> *Naasheer Ali* | Associate Software Engineer
>
> WSO2, Inc |#20, Palm Grove, Colombo 03, Sri Lanka
>
> Email: [email protected]
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Irham Iqbal
Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
lean. enterprise. middleware
phone: +94 777888452
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to