I have a JSONAPI endpoint that returns nested value objects, such as a contact. Wondering if there's a way to express that here, or if jsonapi-requests only supports primitives?
Example:
class LogisticsDelivery(jsonapi_requests.orm.ApiModel):
class Meta:
type = 'logistics-deliveries'
api = api
contact = jsonapi_requests.orm.AttributeField('contact')
deliveries = LogisticsDelivery.get_list()
for delivery in deliveries:
pprint(delivery.contact)
Which outputs
{'email': 'Vancouver_client@food.ee',
'extension': None,
'first-name': 'Vancouver',
'last-name': 'Client',
'phone-number': '+12122708174',
'phone-type': 'none',
'sms-number': '4797755354'}
What I'd love is to be able to define a data class that could wrap this dictionary in a real object, that would allow for getting / setting.