foojayio / discoapi

The foojay discovery api (discoapi) is made to discover java packages (jre/jdk) from different distributions.
GNU General Public License v2.0
111 stars 13 forks source link

Error Codes #18

Closed khmarbaise closed 3 years ago

khmarbaise commented 3 years ago

In cases if combinations of search criterias which would result in an empty result I think it should result into an error code instead of an empty json array.

jeschu commented 3 years ago

Search criteria filter items - if remaining list of filtered items it is an empty result, not an error - just my opinion

HanSolo commented 3 years ago

Added a json msg like { "info":"No package found" } Will close this issue as soon as the code will be in production

marchof commented 3 years ago

Hallo @khmarbaise looks like your proposal has been implemented. I'm not a client side JavaScript expert. Did you have any idea in mind how to use the new API properly? Now my client code looks like this 🙀:

if (Array.isArray(response.data)) {
  this.packages = response.data;
} else {
  this.packages = [];
}
marchof commented 3 years ago

Hi, I think this issue has been resolved long time ago and with the v2.0 API there is a proper machine readable schema for situations with and without result items.

So I think this issues can be closed as fixed. In general as a API user it would be very valuable if the issues' status here would reflect the current status of the API.

HanSolo commented 3 years ago

I agree, sorry for being a bit lazy...