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

Reply via email to