In several cases the Web API returns null-values fields in its JSON answers.
That should be avoided because doing so forces web clients to do extra gymnastics to distinguish the "null" case vs the empty dict/list cases or the absence of a given metadata key. It also wastes bandwidth, but that's a minor point.
I've found at least the following occurrences of this happening, but there might be more:
- https://archive.softwareheritage.org/api/1/origin/git/url/https://github.com/hylang/hy/ (both "lister" and "project" are null)
- https://archive.softwareheritage.org/api/1/origin/1/visits/ ("metadata" is null)
- https://archive.softwareheritage.org/api/1/origin/1/visit/1/ ("metadata" is null)
- https://archive.softwareheritage.org/api/1/revision/9fbd21adbac36be869514e82e2e98505dc47219c/ ("metadata" is null)
We should consistently either return empty dict/lists instead of returning null (depending on the expected type), or consistently removing keys that point to null values from the return dictionaries.