Skip to content

How to get the response in true JSON? #287

@jerinpetergeorge

Description

@jerinpetergeorge

How can I transform the below Customer instance into a JSON?

unit = Unit(settings.UNIT_API_DOMAIN, settings.UNIT_API_KEY)
customer = unit.customers.get("2331163")


json.dumps(customer) # TypeError: Object of type UnitResponse is not JSON serializable

I was expecting some sort of utility functions that convert the entire object (by traversing through the whole object) to a JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions