Skip to content

primelib/osv4j

Repository files navigation

OSV4J

Maven Central javadoc

A java library for the OSV API.

Installation

implementation("io.github.primelib:osv4j:<latestVersion>")

Click to view instructions for other build tools.

Usage

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.

Links

License

Released under the MIT License.