A java library for the OSV API.
implementation("io.github.primelib:osv4j:<latestVersion>")
Click to view instructions for other build tools.
Consumer Specification Approach
OSVConsumerApi client = OSVFactory.create(spec -> {
spec.api(OSVConsumerApi.class);
});
client.getVulnById(spec -> spec.id("GHSA-jfh8-c2jp-5v3q"));
Parameter Approach
OSVApi client = OSVFactory.create(spec -> {
spec.api(OSVApi.class);
});
client.getVulnById("GHSA-jfh8-c2jp-5v3q");
NOTE: The Parameter Approach
can break if the API changes. The Consumer Specification Approach
is more resilient to API changes.
Released under the MIT License.