Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty XML nodes incorrectly serialized/deserialized #449

Open
christopherseeley opened this issue Feb 21, 2020 · 2 comments
Open

Empty XML nodes incorrectly serialized/deserialized #449

christopherseeley opened this issue Feb 21, 2020 · 2 comments
Labels

Comments

@christopherseeley
Copy link
Member

Seems like this zeep issue is impacting Ad Manager:
mvantellingen/python-zeep#923

Specifically, video line items with an empty requestPlatformTargeting. Reading one of these and sending it unchanged in an updateLineItemsRequest fails with NotNullError.NULL @ targeting.requestPlatformTargeting

@aebenw
Copy link

aebenw commented Aug 31, 2021

@christopherseeley Is there any update on this? I am experiencing this same issue.

My job is fetching line items and pushing them back up, this property is not changed though yet I'm getting this error.

@christopherseeley
Copy link
Member Author

As a workaround, you can explicitly set an xsi_type for these line items and zeep will correctly serialize it:

line_item['targeting']['requestPlatformTargeting'] = {
            'xsi_type' : 'RequestPlatformTargeting'
        }

For background, an empty <requestPlatformTargeting/> node gets deserialized to None instead of the RequestPlatformTargeting wrapper object. The workaround coerces zeep to serialize it back as:
<requestPlatformTargeting></requestPlatformTargeting>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants