timotheus / ebaysdk-python

eBay API SDK for Python
https://developer.ebay.com/tools/sdks
Other
808 stars 326 forks source link

specify unit for "WeightMajor" in JSON #341

Open ramzitra opened 3 years ago

ramzitra commented 3 years ago

in Trading API: AddFixedPriceItem , to specify unit for weight, we need to do this is XML : < WeightMinor unit="oz">2< / WeightMinor > How can we set that in the python SDK in JSON format ? Thanks

andrewjcm commented 2 years ago

So... its a little late, but if anyone else searches for this the explanation is in utils.py line 150:

>>> dict3 = {
...    'parent': {'child': {'#text': 222, '@attrs': {'site': 'US', 'id': 1234}}}
... }
>>> dict2xml(dict3)
'<parent><child id="1234" site="US">222</child></parent>'