The ?fields=X selector in the Web API seems to work properly only in simple cases, where the selected field contains a singleton datatype, but it breaks down when it contains more complex data. Some examples:
- https://archive.softwareheritage.org/api/1/origin/1/visit/1/?fields=occurrences → return a dictionary where "occurrences" contains an empty dictionary, whereas in https://archive.softwareheritage.org/api/1/origin/1/visit/1/ "occurrences" points to a very non-empy dict
- https://archive.softwareheritage.org/api/1/revision/ec72c666fb345ea5f21359b7bc063710ce558e39/directory/?fields=content returns a dictionary where "content" point to a list of empty dictionaries (wth?), whereas it should return the same of https://archive.softwareheritage.org/api/1/revision/ec72c666fb345ea5f21359b7bc063710ce558e39/directory/
Note: ?fields is currently well-defined only for endpoints that return a single dictionary; making it work for endpoints that return multiple values (e.g., a list of dicts) is a different problem, independent from this one.