Skip to content

Commit 638450a

Browse files
committed
added templates to support jersey3 in java generator
1 parent 85541d1 commit 638450a

File tree

8 files changed

+1349
-3
lines changed

8 files changed

+1349
-3
lines changed

src/main/java/io/swagger/codegen/v3/generators/java/JavaClientCodegen.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public JavaClientCodegen() {
9090
supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.10.1. Enable gzip request encoding using '-DuseGzipFeature=true'.");
9191
supportedLibraries.put("feign", "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.10.1");
9292
supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.26. JSON processing: Jackson 2.10.1");
93+
supportedLibraries.put("jersey3", "HTTP client: Jersey client 3.0.10. JSON processing: Jackson 2.10.2");
9394
supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
9495
supportedLibraries.put("okhttp4-gson", "HTTP client: OkHttp 4.10.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.");
9596
supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.");
@@ -126,6 +127,10 @@ public void processOpts() {
126127
if (RETROFIT_1.equalsIgnoreCase(library)) {
127128
dateLibrary = "joda";
128129
}
130+
if ("jersey3".equalsIgnoreCase(library)) {
131+
dateLibrary = "java8";
132+
additionalProperties.put(JAKARTA, true);
133+
}
129134

130135
super.processOpts();
131136

@@ -248,7 +253,7 @@ public void processOpts() {
248253
if ("retrofit2".equals(getLibrary()) && !usePlayWS) {
249254
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
250255
}
251-
} else if ("jersey2".equals(getLibrary()) || "resteasy".equals(getLibrary())) {
256+
} else if ("jersey3".equals(getLibrary()) || "jersey2".equals(getLibrary()) || "resteasy".equals(getLibrary())) {
252257
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
253258
additionalProperties.put("jackson", "true");
254259
} else if("jersey1".equals(getLibrary())) {

0 commit comments

Comments
 (0)