AdoptOpenJDK/openjdk-api

API endpoint to list available versions and impls

culmat opened this issue · 3 comments

Through the website I get a drop down
image
fed by https://adoptopenjdk.net/dist/json/config.json
I need this information to call the api via something like https://api.adoptopenjdk.net/v2/info/releases/openjdk8?openjdk_impl=hotspot

I would expect this kind of information under
https://api.adoptopenjdk.net/v2/info/releases/

io7m commented

It turns out that we also need this for the Java API. Without this information, the API essentially becomes impossible to use without knowing every possible build variant ahead of time.

Yes, please. I just finished wrapping the API in a CommandBox CLI command to search for OpenJDK versions and two of the biggest issues I ran into were:

  1. No single API endpoint I can hit that returns results across major versions! i.e., show me every windows hotspot build regardless of whether it's jdk8 or jdk9, etc. There is no way for me to even know what all the major versions are
  2. I get an array back in some cases, but I get an object in other cases where I just change the filter. This makes the API very hard to deal with since I'm never sure what kind of JSON I'll receive (or if I'll even get JSON at all! #113 )

Ex: this search returns an array
https://api.adoptopenjdk.net/v2/info/releases/openjdk8?&openjdk_impl=hotspot&os=windows&arch=x64&release=jdk8u192-b12

But this search which has only changed to get the latest release, returns an object
https://api.adoptopenjdk.net/v2/info/releases/openjdk8?&openjdk_impl=hotspot&os=windows&arch=x64&release=latest

Solved in v3 with Swagger - https://api.adoptopenjdk.net/swagger-ui