Official Java client library for the Prioritize REST API
(/api/v1). It is generated from Prioritize's frozen OpenAPI specification with
OpenAPI Generator (java generator, resttemplate library) — the
sources are never hand-written, so the client always matches the contract of the release it targets.
- Client version tracks the API version: a
1.xclient targets the1.xREST API. - License: Apache-2.0 (same as Prioritize).
- Java 17+
- The generated client uses Spring's
RestTemplateand Jackson (pulled in transitively).
Published on Maven Central:
<dependency>
<groupId>de.hallerweb</groupId>
<artifactId>prioritize-java-client</artifactId>
<version>1.3.1</version>
</dependency>The client version tracks the Prioritize API release it was generated from, so 1.3.1 speaks the
1.3.1 contract.
Create a PrioritizeApiClient, point it at your Prioritize instance, add credentials, then call one of
the per-resource API classes (one per tag: UsersApi, ProjectsApi, TasksApi, ResourcesApi,
DocumentsApi, SkillsApi, ProcessDefinitionsApi, …).
import de.hallerweb.enterprise.prioritize.client.invoker.ApiClient;
import de.hallerweb.enterprise.prioritize.client.invoker.PrioritizeApiClient;
import de.hallerweb.enterprise.prioritize.client.api.UsersApi;
import de.hallerweb.enterprise.prioritize.client.model.UserDTO;
ApiClient client = new PrioritizeApiClient();
client.setBasePath("http://localhost:8080"); // default; the spec paths already include /api/v1
client.setUsername("admin");
client.setPassword("p@ssword");
UsersApi users = new UsersApi(client);
UserDTO me = users.userGetByUsername("admin");
System.out.println(me.getId() + " " + me.getEmail());ApiClient client = new PrioritizeApiClient();
client.setBasePath("https://prioritize.example.com");
client.setBearerToken("<your-JWT-access-token>");
// or a supplier that refreshes the token:
// client.setBearerToken(() -> tokenProvider.currentAccessToken());
ProjectsApi projects = new ProjectsApi(client);
projects.projectGetMyProjects().forEach(p -> System.out.println(p.getName()));Both auth schemes are declared in the spec; the app has exactly one active at a time depending on the
server profile (Basic on the default profile, Bearer/JWT on the keycloak profile).
Because otherwise every PATCH call fails before it leaves the JVM:
org.springframework.web.client.ResourceAccessException: I/O error on PATCH request for
http://localhost:8080/api/v1/resources/40: Invalid HTTP method: PATCH
Caused by: java.net.ProtocolException: Invalid HTTP method: PATCH
The generated ApiClient builds a plain new RestTemplate(), which always transports over
SimpleClientHttpRequestFactory → java.net.HttpURLConnection, and that class has never supported
PATCH (JDK-7016595). PrioritizeApiClient is a
three-line subclass that swaps the transport for JdkClientHttpRequestFactory (Spring's adapter for
java.net.http.HttpClient, already part of spring-web — no extra dependency) and is otherwise
identical. It affects the *PartialUpdate* operations (resources, users, telemetry rules, task
schedules); everything else works either way, so just use PrioritizeApiClient everywhere.
If you build the RestTemplate yourself and pass it to new ApiClient(restTemplate), note that this
constructor skips the generated setup entirely — you then have to configure a DefaultUriBuilderFactory
with EncodingMode.VALUES_ONLY yourself, or query parameters end up double-encoded.
mvn clean installThis regenerates the client from openapi/openapi.json into
target/generated-sources/openapi and compiles it. Apart from the single hand-written
PrioritizeApiClient (see above) there is nothing to hand-edit.
The client is spec-first. To move it to a new Prioritize release:
- Take the released
docs/openapi.jsonfrom the Prioritize repo for that version. - Copy it over
openapi/openapi.jsonand bump this project's<version>to match. - Rebuild.
./generate.sh <path-to-released-openapi.json> automates steps 1–2 and regenerates.
OpenAPI Generator's schema resolver chokes on a 3.1.0 document header even when the schemas
themselves use no 3.1-only constructs (this contract doesn't). Prioritize therefore emits 3.0.1
since the 1.2.0 release (springdoc.api-docs.version: openapi_3_0), so a released docs/openapi.json
is directly consumable. generate.sh still pins the header to 3.0.1 when it imports a spec — now a
no-op safety net for older or hand-exported documents.
de.hallerweb.enterprise.prioritize.client.api— one*Apiclass per resource/tag.de.hallerweb.enterprise.prioritize.client.model— the request/response DTOs.de.hallerweb.enterprise.prioritize.client.invoker—ApiClientand support classes, plusPrioritizeApiClient: the one hand-written class in this project (src/main/java), aPATCH-capableApiClientsubclass. Everything else lives intarget/generated-sources.