Differentiate between null and missing fields in API responses
mainIn API responses, a field might be explicitly null or missing entirely. The library represents both as None. To distinguish between them, check if the field name exists in the .model_fields_set attribute of the response object.
if response.my_field is None:
if 'my_field' not in response.model_fields_set:
print('Got json like {}, without a "my_field" key present at all.')
else:
print('Got json like {"my_field": null}.')