I’m trying to process the Activity Logs REST API, and I’m hitting some problems with the fig_file_view
event having a null details field, as opposed to a populated object, empty object, or object with a null “access” property.
The API hands out a mix of nulls and objects:
"action": { "type": "fig_file_view", "details": null },
"action": { "type": "fig_file_view", "details": { "access": "edit" } },
Ideally, this would be an empty object, or an object with a null access field:
"action": { "type": "fig_file_view", "details": { "access": null } },
"action": { "type": "fig_file_view", "details": {} },
"action": { "type": "fig_file_view", "details": { "access": "edit" } },
I’m currently working around the issue by pre-processing the API response to replace the null
with a {}
before converting to concrete objects.