Expose single properties via API
sormuras opened this issue · 4 comments
It'd be cool, if the API supports access to specific property values.
For example, using https://api.adoptopenjdk.net/openjdk10/nightly/x64_linux/latest/ with .../latest/?get=binaries.binary_link
would return only https://github.com/AdoptOpenJDK/openjdk10-nightly/releases/download/jdk-10%2B23-201818061352/OpenJDK10_x64_Linux_201818061352.tar.gz
.
This would eliminate the need to parse the json output on the client side if the client is only interested in a single property value.
Work-around
Assuming the latest entry is the first in the list:
curl --silent https://api.adoptopenjdk.net/openjdk10-openj9/nightly/x64_linux/ | grep 'binary_link' | grep -Eo '(http|https)://[^"]+' | head -1
@sormuras so it looks like are trying to get the binary link in one step? consider adding /binary
to the end of the request. e.g
curl -OLJ https://api.adoptopenjdk.net/openjdk8/releases/x64_linux/latest/binary
Tried to refactor install-jdk.sh
to digest server-side file names but failed. Using plain binary links works well with https://github.com/sormuras/bach/blob/master/install-jdk.sh#L229 at the moment.
@sormuras - We've looked at the effort for this compared to the value for our end-users and at this stage won't be implementing this. We'll investigate adding a pretty-print though to V3 though.
[...] We'll investigate adding a pretty-print though to V3 though.
That should ease the parsing work on my end. 👍