@ir-kit/openapi-java
v2.0.1
Published
Generate idiomatic Java 17 (java.net.http + Jackson) client SDKs from an OpenAPI 3.x spec.
Maintainers
Readme
@ir-kit/openapi-java
Generate a Java 17 client SDK from an OpenAPI 3.x spec.
- Models are
records; string enums carry their wire value via@JsonValue. - One
<Tag>Apiinterface per tag plus anHttp<Tag>Apiimplementation. - HTTP uses the JDK's
java.net.http.HttpClient; JSON uses Jackson. - The runtime (
ApiClient,RequestOptions,Auth, …) ships as plain Java sources underruntime/.
import { generate } from "@ir-kit/openapi-java";
await generate({
input: "petstore.yaml",
output: "sdk",
packageName: "com.example.petstore",
gradle: true,
});var client = new ApiClient(URI.create("https://petstore.example.com/v3"));
client.auth.put("api_key", new Auth.ApiKey("api_key", "secret", ApiKeyLocation.HEADER));
PetApi pets = new HttpPetApi(client);
Pet pet = pets.getPetById(1L);Runtime dependencies: com.fasterxml.jackson.core:jackson-databind and com.fasterxml.jackson.datatype:jackson-datatype-jsr310.
