metmuseum / openaccess

The Metropolitan Museum of Art's Open Access Initiative
Creative Commons Zero v1.0 Universal
1.16k stars 207 forks source link

Search does not conform to API specs when there is no result #44

Open Fylipp opened 1 year ago

Fylipp commented 1 year ago

According to the API specifications the objectIDs field of a search response is an integer array that defaults to []. However, when performing a search that yields no results (such as https://collectionapi.metmuseum.org/public/collection/v1/search?q=noresult) this is the response I receive from the API:

{"total":0,"objectIDs":null}

It seems the API and specs do not match up. This can be (and has been for me) an unexpected stumbling block.