`/packages` sometimes returns `null` packages in the JSON array

Open
#132 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api, backend

Research direction

Reproduce the supplied /packages request and inspect the response around result[12], where null values are reported. Trace the endpoint implementation responsible for assembling the result array. Done means determining whether null entries are unintended and either preventing them or documenting the expected client behavior, with a regression test if the project has coverage for this endpoint.

Written by the indexing model from the issue text.

Description

When calling the /packages endpoint, sometimes some null elements are returned in the result array.

I got the problem for instance with this call:
https://api.foojay.io/disco/v3.0/packages?jdk_version=21&latest=available&package_type=jdk&distribution=temurin&distribution=zulu&distribution=corretto&distribution=jetbrains&distribution=oracle_open_jdk&distribution=microsoft&distribution=bisheng&distribution=dragonwell&distribution=kona&distribution=liberica&distribution=openlogic&distribution=sap_machine&distribution=semeru&distribution=oracle&distribution=zulu_prime&distribution=semeru_certified&architecture=x86_64&archive_type=tar.gz&archive_type=tgz&archive_type=zip&operating_system=linux&libc_type=glibc&javafx_bundled=false&directly_downloadable=true

Unexpected JSON token at offset 10822: Expected start of the object '{', but had 'n' instead at path: $.result[12]
JSON input: .....size":206305105,"feature":[]},null,null,{"id":"8db33905b983f.....

Sorry that the exception doesn't give me the full JSON body, but we can see enough in the little fragment + the JSON path.

Is this expected? Should I just accept that there might be nulls in the array and filter them out on the client side?

Dominant language
Java
Stars
154
Forks
18
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from foojayio/discoapi

All issues in foojayio/discoapi

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.