Skip to content

Commit 6fb4b8e

Browse files
jminiwing328
authored andcommitted
[java-client] WebClient requires java8 (OpenAPITools#460)
* Usage of webclient library forces java8 to be true * Run bin/java-petstore-webclient.sh
1 parent b664019 commit 6fb4b8e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
package org.openapitools.codegen.languages;
1919

20+
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
21+
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
22+
import static java.util.Collections.sort;
23+
2024
import org.apache.commons.lang3.BooleanUtils;
2125
import org.apache.commons.lang3.StringUtils;
2226
import org.openapitools.codegen.CliOption;
@@ -45,10 +49,6 @@
4549
import java.util.Map;
4650
import java.util.regex.Pattern;
4751

48-
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
49-
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
50-
import static java.util.Collections.sort;
51-
5252
public class JavaClientCodegen extends AbstractJavaCodegen
5353
implements BeanValidationFeatures, PerformBeanValidationFeatures,
5454
GzipFeatures {
@@ -287,6 +287,8 @@ public void processOpts() {
287287
additionalProperties.put("jackson", "true");
288288
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
289289
} else if (WEBCLIENT.equals(getLibrary())) {
290+
setJava8Mode(true);
291+
additionalProperties.put("java8", "true");
290292
additionalProperties.put("jackson", "true");
291293
} else if (VERTX.equals(getLibrary())) {
292294
typeMapping.put("file", "AsyncFile");

samples/client/petstore/java/webclient/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
1212
## Requirements
1313

1414
Building the API client library requires:
15-
1. Java 1.7+
15+
1. Java 1.8+
1616
2. Maven/Gradle
1717

1818
## Installation

0 commit comments

Comments
 (0)