replace tab with spaces (#7625)

This commit is contained in:
William Cheng
2020-10-08 23:00:36 +08:00
committed by GitHub
parent 001533fa63
commit 3d36d491df
25 changed files with 150 additions and 150 deletions

View File

@@ -5,7 +5,7 @@ package {{invokerPackage}};
import java.util.List;
import java.util.Map;
{{#caseInsensitiveResponseHeaders}}
import java.util.Map.Entry;
import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}

View File

@@ -5,7 +5,7 @@ package {{invokerPackage}};
import java.util.Map;
import java.util.List;
{{#caseInsensitiveResponseHeaders}}
import java.util.Map.Entry;
import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}
@@ -34,7 +34,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us
{{#caseInsensitiveResponseHeaders}}
Map<String, List<String>> headers = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
for(Entry<String, List<String>> entry : responseHeaders.entrySet()){
headers.put(entry.getKey().toLowerCase(), entry.getValue());
headers.put(entry.getKey().toLowerCase(), entry.getValue());
}
{{/caseInsensitiveResponseHeaders}}
this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};
@@ -63,7 +63,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us
{{#caseInsensitiveResponseHeaders}}
Map<String, List<String>> headers = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
for(Entry<String, List<String>> entry : responseHeaders.entrySet()){
headers.put(entry.getKey().toLowerCase(), entry.getValue());
headers.put(entry.getKey().toLowerCase(), entry.getValue());
}
{{/caseInsensitiveResponseHeaders}}
this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};

View File

@@ -63,12 +63,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}");
switch (discriminatorValue) {
{{#mappedModels}}
{{#mappedModels}}
case "{{{mappingName}}}":
deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class);
new{{classname}}.setActualInstance(deserialized);
return new{{classname}};
{{/mappedModels}}
{{/mappedModels}}
default:
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue));
}

View File

@@ -62,7 +62,7 @@ public class {{classname}}Test {
*/
@Test
public void {{operationId}}Test() {
// TODO: test validations
// TODO: test validations
{{#allParams}}
{{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}}
{{/allParams}}

View File

@@ -11,10 +11,10 @@
{{#allowableValues}}
{{#withXml}}
{{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{/withXml}}
{{^withXml}}
{{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{/withXml}}
{{/withXml}}
{{^withXml}}
{{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{/withXml}}
{{/allowableValues}}

View File

@@ -5,7 +5,7 @@ package {{invokerPackage}};
import java.util.List;
import java.util.Map;
{{#caseInsensitiveResponseHeaders}}
import java.util.Map.Entry;
import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}

View File

@@ -5,7 +5,7 @@ package {{invokerPackage}};
import java.util.List;
import java.util.Map;
{{#caseInsensitiveResponseHeaders}}
import java.util.Map.Entry;
import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}

View File

@@ -5,7 +5,7 @@ package {{invokerPackage}};
import java.util.Map;
import java.util.List;
{{#caseInsensitiveResponseHeaders}}
import java.util.Map.Entry;
import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}
@@ -31,7 +31,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us
{{#caseInsensitiveResponseHeaders}}
Map<String, List<String>> headers = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
for(Entry<String, List<String>> entry : responseHeaders.entrySet()){
headers.put(entry.getKey().toLowerCase(), entry.getValue());
headers.put(entry.getKey().toLowerCase(), entry.getValue());
}
{{/caseInsensitiveResponseHeaders}}
this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};
@@ -60,7 +60,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us
{{#caseInsensitiveResponseHeaders}}
Map<String, List<String>> headers = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
for(Entry<String, List<String>> entry : responseHeaders.entrySet()){
headers.put(entry.getKey().toLowerCase(), entry.getValue());
headers.put(entry.getKey().toLowerCase(), entry.getValue());
}
{{/caseInsensitiveResponseHeaders}}
this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};

View File

@@ -50,7 +50,7 @@ lazy val root = (project in file(".")).
{{#performBeanValidation}}
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
{{/performBeanValidation}}
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

View File

@@ -29,7 +29,7 @@ lazy val root = (project in file(".")).
"org.apache.commons" % "commons-lang3" % "3.5" % "compile",
"commons-io" % "commons-io" % "2.5" % "compile",
{{/supportJava6}}
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

View File

@@ -623,7 +623,7 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
builder.queryParams(queryParams);
}
URI uri;
URI uri;
try {
uri = new URI(builder.build().toUriString());
} catch(URISyntaxException ex) {

View File

@@ -366,7 +366,7 @@ public class ApiClient {
}
apiAuthorizations.put(authName, authorization);
if(okBuilder == null){
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
}
okBuilder.addInterceptor(authorization);

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-ext
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
version="1.0">
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
version="1.0">
<reload-interval value="3"/>
<context-root uri="book-purchase" />
<enable-directory-browsing value="false"/>
<enable-file-serving value="true"/>
<enable-reloading value="true"/>
<enable-serving-servlets-by-class-name value="false" />
<reload-interval value="3"/>
<context-root uri="book-purchase" />
<enable-directory-browsing value="false"/>
<enable-file-serving value="true"/>
<enable-reloading value="true"/>
<enable-serving-servlets-by-class-name value="false" />
</web-ext>

View File

@@ -1,116 +1,116 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.wasdev.wlp.maven.parent</groupId>
<artifactId>liberty-maven-app-parent</artifactId>
<version>2.6</version>
</parent>
<parent>
<groupId>net.wasdev.wlp.maven.parent</groupId>
<artifactId>liberty-maven-app-parent</artifactId>
<version>2.6</version>
</parent>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{artifactVersion}}</version>
<packaging>war</packaging>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{artifactVersion}}</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>2.0.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>2.0.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<version.maven-war-plugin>3.2.2</version.maven-war-plugin>
<!-- OpenLiberty runtime -->
<version.openliberty-runtime>19.0.0.7</version.openliberty-runtime>
<http.port>9080</http.port>
<https.port>9443</https.port>
<packaging.type>usr</packaging.type>
<app.name>${project.artifactId}</app.name>
<package.file>${project.build.directory}/${app.name}.zip</package.file>
</properties>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<version.maven-war-plugin>3.2.2</version.maven-war-plugin>
<!-- OpenLiberty runtime -->
<version.openliberty-runtime>19.0.0.7</version.openliberty-runtime>
<http.port>9080</http.port>
<https.port>9443</https.port>
<packaging.type>usr</packaging.type>
<app.name>${project.artifactId}</app.name>
<package.file>${project.build.directory}/${app.name}.zip</package.file>
</properties>
<build>
<finalName>{{artifactId}}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<build>
<finalName>{{artifactId}}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${version.maven-war-plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>pom.xml</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${version.maven-war-plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>pom.xml</packagingExcludes>
</configuration>
</plugin>
<!-- Enable liberty-maven plugin -->
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<configuration>
<assemblyArtifact>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>${version.openliberty-runtime}</version>
<type>zip</type>
</assemblyArtifact>
<serverName>OpenAPIGeneratorServer</serverName>
<stripVersion>true</stripVersion>
<configFile>src/main/liberty/config/server.xml</configFile>
<looseApplication>true</looseApplication>
<packageFile>${package.file}</packageFile>
<include>${packaging.type}</include>
<bootstrapProperties>
<default.http.port>${http.port}</default.http.port>
<default.https.port>${https.port}</default.https.port>
<app.context.root>${app.name}</app.context.root>
</bootstrapProperties>
</configuration>
</plugin>
</plugins>
</build>
<!-- Enable liberty-maven plugin -->
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<configuration>
<assemblyArtifact>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>${version.openliberty-runtime}</version>
<type>zip</type>
</assemblyArtifact>
<serverName>OpenAPIGeneratorServer</serverName>
<stripVersion>true</stripVersion>
<configFile>src/main/liberty/config/server.xml</configFile>
<looseApplication>true</looseApplication>
<packageFile>${package.file}</packageFile>
<include>${packaging.type}</include>
<bootstrapProperties>
<default.http.port>${http.port}</default.http.port>
<default.https.port>${https.port}</default.https.port>
<app.context.root>${app.name}</app.context.root>
</bootstrapProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -59,9 +59,9 @@ public class MainApiVerticle extends AbstractVerticle {
}
});
} else {
startFuture.fail(readFile.cause());
startFuture.fail(readFile.cause());
}
});
});
}
public void deployVerticles(Future<Void> startFuture) {
@@ -76,4 +76,4 @@ public class MainApiVerticle extends AbstractVerticle {
});
{{/apis}}{{/apiInfo}}
}
}
}

View File

@@ -43,7 +43,7 @@ public class Order {
@JsonbTypeDeserializer(StatusEnum.Deserializer.class)
public enum StatusEnum {
PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered"));
PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered"));
String value;

View File

@@ -48,7 +48,7 @@ public class Pet {
@JsonbTypeDeserializer(StatusEnum.Deserializer.class)
public enum StatusEnum {
AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold"));
AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold"));
String value;

View File

@@ -21,7 +21,7 @@ lazy val root = (project in file(".")).
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

View File

@@ -19,7 +19,7 @@ lazy val root = (project in file(".")).
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

View File

@@ -20,7 +20,7 @@ lazy val root = (project in file(".")).
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile",
"joda-time" % "joda-time" % "2.9.9" % "compile",
"com.brsanthu" % "migbase64" % "2.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

View File

@@ -577,7 +577,7 @@ public class ApiClient {
builder.queryParams(queryParams);
}
URI uri;
URI uri;
try {
uri = new URI(builder.build().toUriString());
} catch(URISyntaxException ex) {

View File

@@ -572,7 +572,7 @@ public class ApiClient {
builder.queryParams(queryParams);
}
URI uri;
URI uri;
try {
uri = new URI(builder.build().toUriString());
} catch(URISyntaxException ex) {

View File

@@ -312,7 +312,7 @@ public class ApiClient {
}
apiAuthorizations.put(authName, authorization);
if(okBuilder == null){
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
}
okBuilder.addInterceptor(authorization);

View File

@@ -314,7 +314,7 @@ public class ApiClient {
}
apiAuthorizations.put(authName, authorization);
if(okBuilder == null){
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
}
okBuilder.addInterceptor(authorization);

View File

@@ -314,7 +314,7 @@ public class ApiClient {
}
apiAuthorizations.put(authName, authorization);
if(okBuilder == null){
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it");
}
okBuilder.addInterceptor(authorization);