-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Hi. I've just started using the xero-python SDK (v 6.3.0) to retrieve Invoices. There appears to be an issue in the client when serializing UUID fields
This code:
response = accounting_api.get_invoice(XERO_TENANT_ID, invoice_id)
throws a ValueError `Can't serialize value type 'UUID' when attempting to
serialize the model.
I've resolved this issue by patching the serializer based on this suggestion in Issue #93
@serialize_model.register(UUID)
def serialize_uuid_model(model):
"""Serializes api model into an json serializable object.
:param model: BaseModel instance to serialize
:return: serialized object
"""
return model.hex
```
Metadata
Metadata
Assignees
Labels
No labels