Skip to content

Commit 0fdead4

Browse files
chenkinsdkocher
authored andcommitted
Update API bindings and dependencies.
1 parent 06aee39 commit 0fdead4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3598
-3111
lines changed

hub/pom.xml

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
<jwt.version>4.5.0</jwt.version>
1919
<nimbus-jose.version>10.3</nimbus-jose.version>
2020
<swagger-annotations.version>1.6.16</swagger-annotations.version>
21+
22+
<jersey-version>2.37</jersey-version>
23+
<jackson-version>2.19.0</jackson-version>
24+
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
25+
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
2126
</properties>
2227

2328
<profiles>
@@ -58,7 +63,7 @@
5863
<generateModelTests>false</generateModelTests>
5964
<generateSupportingFiles>true</generateSupportingFiles>
6065
<supportingFilesToGenerate>
61-
ApiCallback.java,ApiClient.java,ApiException.java,ApiResponse.java,Configuration.java,Pair.java,ProgressRequestBody.java,ProgressResponseBody.java,StringUtil.java,ApiKeyAuth.java,Authentication.java,HttpBasicAuth.java,JSON.java,OAuth.java,EncodingUtils.java
66+
ApiCallback.java,ApiClient.java,ApiException.java,ApiResponse.java,Configuration.java,Pair.java,ProgressRequestBody.java,ProgressResponseBody.java,StringUtil.java,ApiKeyAuth.java,Authentication.java,HttpBasicAuth.java,JSON.java,OAuth.java,EncodingUtils.java,RFC3339*.java
6267
</supportingFilesToGenerate>
6368
<generateApiDocumentation>false</generateApiDocumentation>
6469
</configuration>
@@ -101,12 +106,6 @@
101106
<artifactId>nimbus-jose-jwt</artifactId>
102107
<version>${nimbus-jose.version}</version>
103108
</dependency>
104-
<dependency>
105-
<!-- used in code generated by openapitools -->
106-
<groupId>org.openapitools</groupId>
107-
<artifactId>jackson-databind-nullable</artifactId>
108-
<version>0.2.6</version>
109-
</dependency>
110109
<dependency>
111110
<groupId>io.swagger</groupId>
112111
<artifactId>swagger-annotations</artifactId>
@@ -129,5 +128,87 @@
129128
<artifactId>testcontainers</artifactId>
130129
<scope>test</scope>
131130
</dependency>
131+
132+
<!-- @Nullable annotation -->
133+
<dependency>
134+
<groupId>com.google.code.findbugs</groupId>
135+
<artifactId>jsr305</artifactId>
136+
<version>3.0.2</version>
137+
</dependency>
138+
139+
<!-- HTTP client: jersey-client -->
140+
<dependency>
141+
<groupId>org.glassfish.jersey.core</groupId>
142+
<artifactId>jersey-client</artifactId>
143+
<version>${jersey-version}</version>
144+
</dependency>
145+
<dependency>
146+
<groupId>org.glassfish.jersey.inject</groupId>
147+
<artifactId>jersey-hk2</artifactId>
148+
<version>${jersey-version}</version>
149+
</dependency>
150+
<dependency>
151+
<groupId>org.glassfish.jersey.media</groupId>
152+
<artifactId>jersey-media-multipart</artifactId>
153+
<version>${jersey-version}</version>
154+
</dependency>
155+
<dependency>
156+
<groupId>org.glassfish.jersey.media</groupId>
157+
<artifactId>jersey-media-json-jackson</artifactId>
158+
<version>${jersey-version}</version>
159+
</dependency>
160+
161+
<!-- JSON processing: jackson -->
162+
<dependency>
163+
<groupId>com.fasterxml.jackson.core</groupId>
164+
<artifactId>jackson-core</artifactId>
165+
<version>${jackson-version}</version>
166+
</dependency>
167+
<dependency>
168+
<groupId>com.fasterxml.jackson.core</groupId>
169+
<artifactId>jackson-annotations</artifactId>
170+
<version>${jackson-version}</version>
171+
</dependency>
172+
<dependency>
173+
<groupId>com.fasterxml.jackson.core</groupId>
174+
<artifactId>jackson-databind</artifactId>
175+
<version>${jackson-version}</version>
176+
</dependency>
177+
<dependency>
178+
<groupId>org.openapitools</groupId>
179+
<artifactId>jackson-databind-nullable</artifactId>
180+
<version>${jackson-databind-nullable-version}</version>
181+
</dependency>
182+
<dependency>
183+
<groupId>com.fasterxml.jackson.datatype</groupId>
184+
<artifactId>jackson-datatype-joda</artifactId>
185+
<version>${jackson-version}</version>
186+
</dependency>
187+
<dependency>
188+
<groupId>com.fasterxml.jackson.datatype</groupId>
189+
<artifactId>jackson-datatype-jsr310</artifactId>
190+
<version>${jackson-version}</version>
191+
</dependency>
192+
<dependency>
193+
<groupId>com.fasterxml.jackson.dataformat</groupId>
194+
<artifactId>jackson-dataformat-cbor</artifactId>
195+
<version>${jackson-version}</version>
196+
</dependency>
197+
<dependency>
198+
<groupId>com.fasterxml.jackson.module</groupId>
199+
<artifactId>jackson-module-jaxb-annotations</artifactId>
200+
<version>${jackson-version}</version>
201+
</dependency>
202+
<dependency>
203+
<groupId>jakarta.annotation</groupId>
204+
<artifactId>jakarta.annotation-api</artifactId>
205+
<version>${jakarta-annotation-version}</version>
206+
<scope>provided</scope>
207+
</dependency>
208+
<dependency>
209+
<groupId>org.glassfish.jersey.connectors</groupId>
210+
<artifactId>jersey-apache-connector</artifactId>
211+
<version>${jersey-version}</version>
212+
</dependency>
132213
</dependencies>
133214
</project>

hub/src/main/java/cloud/katta/client/ApiClient.java

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
/*
2-
* Copyright (c) 2025 shift7 GmbH. All rights reserved.
3-
*/
4-
51
/*
62
* hub-backend API
73
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
84
*
9-
* The version of the OpenAPI document: 1.4.0-SNAPSHOT
10-
*
5+
* The version of the OpenAPI document: 1.5.0-SNAPSHOT
6+
*
117
*
128
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
139
* https://openapi-generator.tech
@@ -52,18 +48,22 @@
5248
import java.nio.file.Paths;
5349
import java.nio.file.StandardCopyOption;
5450
import org.glassfish.jersey.logging.LoggingFeature;
55-
51+
import java.util.AbstractMap.SimpleEntry;
52+
import java.util.logging.Level;
5653
import java.util.logging.Logger;
5754
import java.util.Collection;
5855
import java.util.Collections;
5956
import java.util.Map;
6057
import java.util.Map.Entry;
6158
import java.util.HashMap;
6259
import java.util.LinkedHashMap;
60+
import java.util.LinkedHashSet;
6361
import java.util.List;
6462
import java.util.Arrays;
6563
import java.util.ArrayList;
6664
import java.util.Date;
65+
import java.util.stream.Collectors;
66+
import java.util.stream.Stream;
6767

6868
import java.net.URLEncoder;
6969

@@ -82,15 +82,15 @@
8282
/**
8383
* <p>ApiClient class.</p>
8484
*/
85-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0")
85+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
8686
public class ApiClient {
87-
private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
87+
protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
8888

8989
protected Map<String, String> defaultHeaderMap = new HashMap<>();
9090
protected Map<String, String> defaultCookieMap = new HashMap<>();
9191
protected String basePath = "http://localhost";
9292
protected String userAgent;
93-
private static final Logger log = Logger.getLogger(ApiClient.class.getName());
93+
protected static final Logger log = Logger.getLogger(ApiClient.class.getName());
9494

9595
protected List<ServerConfiguration> servers = new ArrayList<>(Arrays.asList(
9696
new ServerConfiguration(
@@ -107,7 +107,7 @@ public class ApiClient {
107107
protected boolean debugging = false;
108108
protected ClientConfig clientConfig;
109109
protected int connectionTimeout = 0;
110-
private int readTimeout = 0;
110+
protected int readTimeout = 0;
111111

112112
protected Client httpClient;
113113
protected JSON json;
@@ -137,7 +137,7 @@ public ApiClient(Map<String, Authentication> authMap) {
137137
this.dateFormat = new RFC3339DateFormat();
138138

139139
// Set default User-Agent.
140-
setUserAgent("OpenAPI-Generator/1.4.0-SNAPSHOT/java");
140+
setUserAgent("OpenAPI-Generator/1.5.0-SNAPSHOT/java");
141141

142142
// Setup authentications (key: authentication name, value: authentication).
143143
authentications = new HashMap<>();
@@ -264,7 +264,7 @@ public ApiClient setServerVariables(Map<String, String> serverVariables) {
264264
return this;
265265
}
266266

267-
private void updateBasePath() {
267+
protected void updateBasePath() {
268268
if (serverIndex != null) {
269269
setBasePath(servers.get(serverIndex).URL(serverVariables));
270270
}
@@ -475,6 +475,7 @@ public boolean isDebugging() {
475475
*/
476476
public ApiClient setDebugging(boolean debugging) {
477477
this.debugging = debugging;
478+
applyDebugSetting(this.clientConfig);
478479
// Rebuild HTTP Client according to the new "debugging" value.
479480
this.httpClient = buildHttpClient();
480481
return this;
@@ -799,15 +800,15 @@ public Entity<?> serialize(Object obj, Map<String, Object> formParams, String co
799800
return entity;
800801
}
801802

802-
/**
803+
/**
803804
* Adds the object with the provided key to the MultiPart.
804805
* Based on the object type sets Content-Disposition and Content-Type.
805806
*
806807
* @param obj Object
807808
* @param key Key of the object
808809
* @param multiPart MultiPart to add the form param to
809810
*/
810-
private void addParamToMultipart(Object value, String key, MultiPart multiPart) {
811+
protected void addParamToMultipart(Object value, String key, MultiPart multiPart) {
811812
if (value instanceof File) {
812813
File file = (File) value;
813814
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key)
@@ -827,7 +828,7 @@ private void addParamToMultipart(Object value, String key, MultiPart multiPart)
827828
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build();
828829
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value)));
829830
}
830-
}
831+
}
831832

832833
/**
833834
* Serialize the given Java object into string according the given
@@ -1011,6 +1012,22 @@ public <T> ApiResponse<T> invokeAPI(
10111012
// to support (constant) query string in `path`, e.g. "/posts?draft=1"
10121013
WebTarget target = httpClient.target(targetURL);
10131014

1015+
// put all headers in one place
1016+
Map<String, String> allHeaderParams = new HashMap<>(defaultHeaderMap);
1017+
allHeaderParams.putAll(headerParams);
1018+
1019+
if (authNames != null) {
1020+
// update different parameters (e.g. headers) for authentication
1021+
updateParamsForAuth(
1022+
authNames,
1023+
queryParams,
1024+
allHeaderParams,
1025+
cookieParams,
1026+
null,
1027+
method,
1028+
target.getUri());
1029+
}
1030+
10141031
if (queryParams != null) {
10151032
for (Pair queryParam : queryParams) {
10161033
if (queryParam.getValue() != null) {
@@ -1041,22 +1058,6 @@ public <T> ApiResponse<T> invokeAPI(
10411058

10421059
Entity<?> entity = serialize(body, formParams, contentType, isBodyNullable);
10431060

1044-
// put all headers in one place
1045-
Map<String, String> allHeaderParams = new HashMap<>(defaultHeaderMap);
1046-
allHeaderParams.putAll(headerParams);
1047-
1048-
if (authNames != null) {
1049-
// update different parameters (e.g. headers) for authentication
1050-
updateParamsForAuth(
1051-
authNames,
1052-
queryParams,
1053-
allHeaderParams,
1054-
cookieParams,
1055-
null,
1056-
method,
1057-
target.getUri());
1058-
}
1059-
10601061
for (Entry<String, String> entry : allHeaderParams.entrySet()) {
10611062
String value = entry.getValue();
10621063
if (value != null) {
@@ -1105,7 +1106,7 @@ public <T> ApiResponse<T> invokeAPI(
11051106
}
11061107
}
11071108

1108-
private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) {
1109+
protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) {
11091110
Response response;
11101111
if ("POST".equals(method)) {
11111112
response = invocationBuilder.post(entity);
@@ -1139,8 +1140,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
11391140
* @return Client
11401141
*/
11411142
protected Client buildHttpClient() {
1142-
// recreate the client config to pickup changes
1143-
clientConfig = getDefaultClientConfig();
1143+
// Create ClientConfig if it has not been initialized yet
1144+
if (clientConfig == null) {
1145+
clientConfig = getDefaultClientConfig();
1146+
}
11441147

11451148
ClientBuilder clientBuilder = ClientBuilder.newBuilder();
11461149
clientBuilder = clientBuilder.withConfig(clientConfig);
@@ -1161,6 +1164,11 @@ public ClientConfig getDefaultClientConfig() {
11611164
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
11621165
// turn off compliance validation to be able to send payloads with DELETE calls
11631166
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
1167+
applyDebugSetting(clientConfig);
1168+
return clientConfig;
1169+
}
1170+
1171+
protected void applyDebugSetting(ClientConfig clientConfig) {
11641172
if (debugging) {
11651173
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
11661174
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
@@ -1170,8 +1178,6 @@ public ClientConfig getDefaultClientConfig() {
11701178
// suppress warnings for payloads with DELETE calls:
11711179
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
11721180
}
1173-
1174-
return clientConfig;
11751181
}
11761182

11771183
/**
@@ -1263,4 +1269,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
12631269
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
12641270
}
12651271
}
1266-
}
1272+
}

hub/src/main/java/cloud/katta/client/ApiException.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
/*
2-
* Copyright (c) 2025 shift7 GmbH. All rights reserved.
3-
*/
4-
51
/*
62
* hub-backend API
73
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
84
*
9-
* The version of the OpenAPI document: 1.4.0-SNAPSHOT
10-
*
5+
* The version of the OpenAPI document: 1.5.0-SNAPSHOT
6+
*
117
*
128
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
139
* https://openapi-generator.tech
@@ -23,7 +19,7 @@
2319
/**
2420
* API Exception
2521
*/
26-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0")
22+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
2723
public class ApiException extends Exception {
2824
private static final long serialVersionUID = 1L;
2925

hub/src/main/java/cloud/katta/client/ApiResponse.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
/*
2-
* Copyright (c) 2025 shift7 GmbH. All rights reserved.
3-
*/
4-
51
/*
62
* hub-backend API
73
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
84
*
9-
* The version of the OpenAPI document: 1.4.0-SNAPSHOT
10-
*
5+
* The version of the OpenAPI document: 1.5.0-SNAPSHOT
6+
*
117
*
128
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
139
* https://openapi-generator.tech

0 commit comments

Comments
 (0)