Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could the server always return arrays of releases? #47

Closed
io7m opened this issue Mar 8, 2018 · 6 comments
Closed

Could the server always return arrays of releases? #47

io7m opened this issue Mar 8, 2018 · 6 comments

Comments

@io7m
Copy link

io7m commented Mar 8, 2018

Take a look at the output of https://api.adoptopenjdk.net/openjdk8-openj9/releases:

{
  "release_name": "jdk8u152-b16",
  "timestamp": "2018-01-31T11:41:36Z",
  "binaries": [
    {
      "platform": "Linux ppc64le",
      "binary_name": "OpenJDK8-OPENJ9_ppc64le_Linux_jdk8u152-b16.tar.gz",
      "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-openj9-releases/releases/download/jdk8u152-b16/OpenJDK8-OPENJ9_ppc64le_Linux_jdk8u152-b16.tar.gz",
      "binary_size": "78 MB",
      "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-openj9-releases/releases/download/jdk8u152-b16/OpenJDK8-OPENJ9_ppc64le_Linux_jdk8u152-b16.sha256.txt"
    },
...

Now take a look at the output of https://api.adoptopenjdk.net/openjdk8/releases:

[
  {
    "release_name": "jdk8u144-b01",
    "timestamp": "2017-07-27T22:01:53Z",
    "binaries": [
      {
        "platform": "Linux aarch64",
        "binary_name": "OpenJDK8_aarch64_Linux_jdk8u144-b01.tar.gz",
        "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-releases/releases/download/jdk8u144-b01/OpenJDK8_aarch64_Linux_jdk8u144-b01.tar.gz",
        "binary_size": "72 MB",
        "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-releases/releases/download/jdk8u144-b01/OpenJDK8_aarch64_Linux_jdk8u144-b01.sha256.txt"
      },
...

Note that the endpoint returns an array when there's more than one release. The problem with this is that if you think of the endpoint as a method call, then the type of the method changes based on how many releases there are... I feel like it'd be cleaner if the endpoint could commit to always returning an array, even if there's only a single element.

@gdams
Copy link
Member

gdams commented Mar 10, 2018

Hmm yeah, this seems like a bug... we should be able to fix it

@gdams gdams added the bug label Mar 10, 2018
@io7m
Copy link
Author

io7m commented Oct 31, 2018

'Ello.

Any movement on this? It's still causing the Java API test suite to fail. If this isn't going to change any time soon, I can probably update the Java API to be tolerant of receiving objects in addition to arrays.

@karianna
Copy link
Member

@io7m Can you try with the v2 API and see if that works for you?

@io7m
Copy link
Author

io7m commented Oct 31, 2018

I've allowed the v1 implementation to accept objects in addition to arrays. I'm currently blocked on #75 as it's not possible to produce an API with equivalent functionality without that info.

@johnoliver
Copy link
Member

For specifically this issue, I believe any request to the v2 api that has the possibility to return more than 1 request will return an array. As for the v1 api, I dont think any more changes are going to go into it, so this issue should probably be closed

@karianna
Copy link
Member

OK closing this and we'll look at #75

openjdk-api automation moved this from To-Do to Done Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
openjdk-api
  
Done
Development

No branches or pull requests

4 participants