Merge remote-tracking branch 'origin/master' into 6.0.x

This commit is contained in:
William Cheng 2022-01-03 18:03:00 +08:00
commit d17a472b89
904 changed files with 98009 additions and 10293 deletions

View File

@ -0,0 +1,6 @@
generatorName: java-play-framework
outputDir: samples/server/petstore/java-play-framework-fake-endpoints-with-security
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-for-testing-playframework-with-security.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework
additionalProperties:
hideGenerationTimestamp: "true"

View File

@ -0,0 +1,13 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
java8: "false"
useBeanValidation: true
artifactId: spring-boot-beanvalidation-no-nullable
hideGenerationTimestamp: "true"
openApiNullable: "false"

View File

@ -0,0 +1,11 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-delegate
hideGenerationTimestamp: "true"
java8: true
delegatePattern: "true"

View File

@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-implicitHeaders
hideGenerationTimestamp: "true"
implicitHeaders: true

View File

@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot
snapshotVersion: "true"
oas3: "true"
hideGenerationTimestamp: "true"

View File

@ -0,0 +1,11 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-reactive
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-reactive
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"

View File

@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-useoptional
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"

View File

@ -0,0 +1,12 @@
generatorName: spring
outputDir: samples/openapi3/client/petstore/spring-cloud-async
library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
async: "true"
java8: "true"
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"

View File

@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-date-time-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@ -0,0 +1,10 @@
generatorName: spring
library: spring-cloud
outputDir: samples/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"

View File

@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/client/petstore/spring-cloud-spring-pageable
library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: spring-cloud-spring-pageable
hideGenerationTimestamp: 'true'

View File

@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java|
|supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|

View File

@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
|supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|

View File

@ -4103,7 +4103,7 @@ public class DefaultCodegen implements CodegenConfig {
}
// add example
if (schemas != null) {
if (schemas != null && !isSkipOperationExample()) {
op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType);
}
}

View File

@ -175,7 +175,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen
if (languageSpecificPrimitives.contains(name)) {
return name;
} else {
return name;
return super.getTypeDeclaration(name);
}
}

View File

@ -102,6 +102,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse)));
cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations));
cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string."));
cliOptions.add(CliOption.newBoolean(SUPPORT_ASYNC, "Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).", supportAsync));
}
@Override
@ -121,6 +122,14 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
additionalProperties.remove(RETURN_RESPONSE);
}
}
if (additionalProperties.containsKey(SUPPORT_ASYNC)) {
supportAsync = Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString());
if (!supportAsync) {
additionalProperties.remove(SUPPORT_ASYNC);
} else {
setJava8ModeAndAdditionalProperties(true);
}
}
if (QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || OPEN_LIBERTY_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) {
useSwaggerAnnotations = false;
} else {

View File

@ -15,6 +15,7 @@ import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE;
@ -97,18 +98,18 @@ public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements B
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation));
CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool);
buildToolOption.setEnum(new HashMap<String, String>() {{
put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
}});
Map buildToolOptionMap = new HashMap();
buildToolOptionMap.put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
buildToolOptionMap.put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
buildToolOptionMap.put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
buildToolOption.setEnum(buildToolOptionMap);
cliOptions.add(buildToolOption);
CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool);
testToolOption.setEnum(new HashMap<String, String>() {{
put(OPT_TEST_JUNIT, "Use JUnit as test tool");
put(OPT_TEST_SPOCK, "Use Spock as test tool");
}});
Map testToolOptionMap = new HashMap();
testToolOptionMap.put(OPT_TEST_JUNIT, "Use JUnit as test tool");
testToolOptionMap.put(OPT_TEST_SPOCK, "Use Spock as test tool");
testToolOption.setEnum(testToolOptionMap);
cliOptions.add(testToolOption);
// Remove the date library option

View File

@ -18,6 +18,7 @@
package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.meta.features.DocumentationFeature;
@ -25,11 +26,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.openapitools.codegen.utils.StringUtils.camelize;
@ -45,6 +45,10 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
public static final String USE_SWAGGER_UI = "useSwaggerUI";
public static final String SUPPORT_ASYNC = "supportAsync";
private static final String X_JWKS_URL = "x-jwksUrl";
private static final String X_TOKEN_INTROSPECT_URL = "x-tokenIntrospectUrl";
protected String title = "openapi-java-playframework";
protected String configPackage = "org.openapitools.configuration";
protected String basePackage = "org.openapitools";
@ -197,6 +201,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
supportingFiles.add(new SupportingFile("module.mustache", "app", "Module.java"));
}
supportingFiles.add(new SupportingFile("openapiUtils.mustache", "app/openapitools", "OpenAPIUtils.java"));
supportingFiles.add(new SupportingFile("securityApiUtils.mustache", "app/openapitools", "SecurityAPIUtils.java"));
if (this.handleExceptions) {
supportingFiles.add(new SupportingFile("errorHandler.mustache", "app/openapitools", "ErrorHandler.java"));
}
@ -376,4 +381,98 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea
generateJSONSpecFile(objs);
return super.postProcessSupportingFileData(objs);
}
@Override
public List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> securitySchemeMap) {
List<? extends CodegenSecurity> securities = super.fromSecurity(securitySchemeMap);
List<CodegenSecurity> extendedSecurities = new ArrayList<>();
for (CodegenSecurity codegenSecurity : securities) {
ExtendedCodegenSecurity extendedCodegenSecurity = new ExtendedCodegenSecurity(codegenSecurity);
Object jwksUrl = extendedCodegenSecurity.vendorExtensions.get(X_JWKS_URL);
if (jwksUrl instanceof String) {
extendedCodegenSecurity.jwksUrl = (String) jwksUrl;
}
Object tokenIntrospectUrl = extendedCodegenSecurity.vendorExtensions.get(X_TOKEN_INTROSPECT_URL);
if (tokenIntrospectUrl instanceof String) {
extendedCodegenSecurity.tokenIntrospectUrl = (String) tokenIntrospectUrl;
}
extendedSecurities.add(extendedCodegenSecurity);
}
return extendedSecurities;
}
class ExtendedCodegenSecurity extends CodegenSecurity {
public String jwksUrl;
public String tokenIntrospectUrl;
public ExtendedCodegenSecurity(CodegenSecurity cm) {
super();
this.name = cm.name;
this.type = cm.type;
this.scheme = cm.scheme;
this.isBasic = cm.isBasic;
this.isOAuth = cm.isOAuth;
this.isApiKey = cm.isApiKey;
this.isBasicBasic = cm.isBasicBasic;
this.isBasicBearer = cm.isBasicBearer;
this.isHttpSignature = cm.isHttpSignature;
this.bearerFormat = cm.bearerFormat;
this.vendorExtensions = new HashMap<String, Object>(cm.vendorExtensions);
this.keyParamName = cm.keyParamName;
this.isKeyInQuery = cm.isKeyInQuery;
this.isKeyInHeader = cm.isKeyInHeader;
this.isKeyInCookie = cm.isKeyInCookie;
this.flow = cm.flow;
this.authorizationUrl = cm.authorizationUrl;
this.tokenUrl = cm.tokenUrl;
this.refreshUrl = cm.refreshUrl;
this.scopes = cm.scopes;
this.isCode = cm.isCode;
this.isPassword = cm.isPassword;
this.isApplication = cm.isApplication;
this.isImplicit = cm.isImplicit;
}
@Override
public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
CodegenSecurity codegenSecurity = super.filterByScopeNames(filterScopes);
ExtendedCodegenSecurity extendedCodegenSecurity = new ExtendedCodegenSecurity(codegenSecurity);
extendedCodegenSecurity.jwksUrl = this.jwksUrl;
extendedCodegenSecurity.tokenIntrospectUrl = this.tokenIntrospectUrl;
return extendedCodegenSecurity;
}
@Override
public boolean equals(Object o) {
boolean result = super.equals(o);
JavaPlayFrameworkCodegen.ExtendedCodegenSecurity that = (JavaPlayFrameworkCodegen.ExtendedCodegenSecurity) o;
return result &&
Objects.equals(jwksUrl, that.jwksUrl) &&
Objects.equals(tokenIntrospectUrl, that.tokenIntrospectUrl);
}
@Override
public int hashCode() {
int superHash = super.hashCode();
return Objects.hash(superHash, tokenIntrospectUrl, jwksUrl);
}
@Override
public String toString() {
String superString = super.toString();
final StringBuilder sb = new StringBuilder(superString);
sb.append(", jwksUrl='").append(jwksUrl).append('\'');
sb.append(", tokenIntrospectUrl='").append(tokenIntrospectUrl).append('\'');
return sb.toString();
}
}
}

View File

@ -1041,7 +1041,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig {
Map<?, ?> respExtensions = (Map<?, ?>) resp.getExtensions().get(X_OPERATION_RESPONSE);
Entry<?, ?> entry = respExtensions.entrySet().stream().findFirst().orElse(null);
if (entry.getKey().equals(X_OPERATION_RESPONSE_HIDE)) {
if (entry != null && entry.getKey().equals(X_OPERATION_RESPONSE_HIDE)) {
return Boolean.parseBoolean(String.valueOf(entry.getValue()));
}
}

View File

@ -541,10 +541,12 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
.forEach(cm -> {
cm.imports.add(importMapping.get("JsonValue"));
cm.imports.add(importMapping.get("JsonProperty"));
Map<String, String> item = new HashMap<>();
item.put("import", importMapping.get("JsonValue"));
item.put("import", importMapping.get("JsonProperty"));
imports.add(item);
Map<String, String> itemJsonValue = new HashMap<>();
itemJsonValue.put("import", importMapping.get("JsonValue"));
imports.add(itemJsonValue);
Map<String, String> itemJsonProperty = new HashMap<>();
itemJsonProperty.put("import", importMapping.get("JsonProperty"));
imports.add(itemJsonProperty);
});
return objs;

View File

@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import io.swagger.v3.oas.models.media.Schema;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
@ -923,6 +924,17 @@ public class SpringCodegen extends AbstractJavaCodegen
}
}
@Override
public CodegenModel fromModel(String name, Schema model) {
CodegenModel codegenModel = super.fromModel(name, model);
if (oas3) {
// remove swagger2 imports
codegenModel.imports.remove("ApiModelProperty");
codegenModel.imports.remove("ApiModel");
}
return codegenModel;
}
@Override
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
objs = super.postProcessModelsEnum(objs);

View File

@ -41,10 +41,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -173,7 +173,7 @@ public class {{classname}} {
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -204,7 +204,7 @@ public class {{classname}} {
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -9,6 +9,10 @@ import javax.ws.rs.core.Response;
{{#useSwaggerAnnotations}}
import io.swagger.annotations.*;
{{/useSwaggerAnnotations}}
{{#supportAsync}}
import java.util.concurrent.CompletionStage;
import java.util.concurrent.CompletableFuture;
{{/supportAsync}}
import java.io.InputStream;
import java.util.Map;

View File

@ -10,4 +10,4 @@
{{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} })
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}}
{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}});
{{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}});

View File

@ -11,6 +11,6 @@
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}
}){{/useSwaggerAnnotations}}
public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) {
return Response.ok().entity("magic!").build();
public {{#supportAsync}}CompletionStage<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) {
return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}};
}

View File

@ -140,6 +140,11 @@
{{/useBeanValidation}}
</dependencies>
<properties>
{{#java8}}
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
{{/java8}}
<jackson-version>2.9.9</jackson-version>
<junit-version>4.13.1</junit-version>
{{#useBeanValidation}}

View File

@ -0,0 +1 @@
CompletionStage<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map<String, {{{returnBaseType}}}>{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}>

View File

@ -13,3 +13,6 @@ libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5"
libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final"
{{/useBeanValidation}}
libraryDependencies += guice
libraryDependencies += "com.auth0" % "java-jwt" % "3.18.1"
libraryDependencies += "com.auth0" % "jwks-rsa" % "0.19.0"
libraryDependencies += "org.apache.httpcomponents" % "httpclient" % "4.5.6"

View File

@ -1,6 +1,7 @@
import com.google.inject.AbstractModule;
import {{apiPackage}}.*;
import openapitools.SecurityAPIUtils;
public class Module extends AbstractModule {
@ -11,5 +12,6 @@ public class Module extends AbstractModule {
bind({{classname}}ControllerImpInterface.class).to({{classname}}ControllerImp.class);
{{/apis}}
{{/apiInfo}}
bind(SecurityAPIUtils.class);
}
}

View File

@ -20,6 +20,9 @@ import play.libs.Files.TemporaryFile;
import java.io.IOException;
{{/handleExceptions}}
import openapitools.OpenAPIUtils;
{{^useInterfaces}}
import openapitools.SecurityAPIUtils;
{{/useInterfaces}}
import com.fasterxml.jackson.core.type.TypeReference;
{{#supportAsync}}
@ -46,9 +49,12 @@ public class {{classname}}Controller extends Controller {
{{#useBeanValidation}}
private final Config configuration;
{{/useBeanValidation}}
{{^useInterfaces}}
private final SecurityAPIUtils securityAPIUtils;
{{/useInterfaces}}
@Inject
private {{classname}}Controller({{#useBeanValidation}}Config configuration{{^controllerOnly}}, {{/controllerOnly}}{{/useBeanValidation}}{{^controllerOnly}}{{classname}}ControllerImp{{#useInterfaces}}Interface{{/useInterfaces}} imp{{/controllerOnly}}) {
private {{classname}}Controller({{#useBeanValidation}}Config configuration{{^controllerOnly}}, {{/controllerOnly}}{{/useBeanValidation}}{{^controllerOnly}}{{classname}}ControllerImp{{#useInterfaces}}Interface{{/useInterfaces}} imp{{/controllerOnly}}{{^useInterfaces}}, SecurityAPIUtils securityAPIUtils{{/useInterfaces}}) {
{{^controllerOnly}}
this.imp = imp;
{{/controllerOnly}}
@ -56,6 +62,9 @@ public class {{classname}}Controller extends Controller {
{{#useBeanValidation}}
this.configuration = configuration;
{{/useBeanValidation}}
{{^useInterfaces}}
this.securityAPIUtils = securityAPIUtils;
{{/useInterfaces}}
}
{{#operation}}

View File

@ -14,7 +14,9 @@ import play.mvc.Result;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import openapitools.OpenAPIUtils;
import openapitools.SecurityAPIUtils;
import static play.mvc.Results.ok;
import static play.mvc.Results.unauthorized;
import play.libs.Files.TemporaryFile;
{{#supportAsync}}
import java.util.concurrent.CompletionException;
@ -32,11 +34,12 @@ public abstract class {{classname}}ControllerImpInterface {
{{#useBeanValidation}}
@Inject private Config configuration;
{{/useBeanValidation}}
@Inject private SecurityAPIUtils securityAPIUtils;
private ObjectMapper mapper = new ObjectMapper();
{{#operation}}
public {{#supportAsync}}CompletionStage<{{/supportAsync}}Result{{#supportAsync}}>{{/supportAsync}} {{operationId}}Http(Http.Request request{{#hasParams}}, {{/hasParams}}{{#allParams}}{{>pathParams}}{{>queryParams}}{{>bodyParams}}{{>formParams}}{{>headerParams}}{{^-last}}, {{/-last}}{{/allParams}}) {{#handleExceptions}}throws Exception{{/handleExceptions}} {
{{>responseToResult}}
{{>responseToResult}}
}
public abstract {{^returnType}}void{{/returnType}}{{#returnType}}{{#supportAsync}}CompletionStage<{{/supportAsync}}{{>returnTypesNoVoid}}{{#supportAsync}}>{{/supportAsync}}{{/returnType}} {{operationId}}(Http.Request request{{#hasParams}}, {{/hasParams}}{{#allParams}}{{>pathParams}}{{>queryParams}}{{>bodyParams}}{{>formParams}}{{>headerParams}}{{^-last}}, {{/-last}}{{/allParams}}) {{#handleExceptions}}throws Exception{{/handleExceptions}};

View File

@ -1,55 +1,46 @@
{{^controllerOnly}}
{{#authMethods.0}}
{{#isOAuth}}
if (!securityAPIUtils.isRequestTokenValid(request, "{{name}}")) {
return {{#supportAsync}}CompletableFuture.supplyAsync(play.mvc.Results::unauthorized){{/supportAsync}}{{^supportAsync}}unauthorized(){{/supportAsync}};
}
{{/isOAuth}}
{{/authMethods.0}}
{{^returnType}}
{{#supportAsync}}
CompletableFuture<Result> result = CompletableFuture.supplyAsync(() -> {
CompletableFuture<Result> result = CompletableFuture.supplyAsync(() -> {
try {
{{/supportAsync}}
{{/returnType}}
{{#returnType}}{{#supportAsync}}CompletionStage<{{>returnTypesNoVoid}}> stage = {{/supportAsync}}{{^supportAsync}}{{>returnTypesNoVoid}} obj = {{/supportAsync}}{{/returnType}}{{^returnType}}{{#supportAsync}} {{/supportAsync}}{{/returnType}}{{^useInterfaces}}imp.{{/useInterfaces}}{{operationId}}(request{{#hasParams}}, {{/hasParams}}{{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}{{#supportAsync}}.thenApply(obj -> { {{/supportAsync}}{{/returnType}}{{^supportAsync}};{{/supportAsync}}{{#supportAsync}}{{^returnType}};{{/returnType}}{{/supportAsync}}
{{#returnType}}{{#supportAsync}}CompletionStage<{{>returnTypesNoVoid}}> stage = {{/supportAsync}}{{^supportAsync}}{{>returnTypesNoVoid}} obj = {{/supportAsync}}{{/returnType}}{{^returnType}}{{#supportAsync}} {{/supportAsync}}{{/returnType}}{{^useInterfaces}}imp.{{/useInterfaces}}{{operationId}}(request{{#hasParams}}, {{/hasParams}}{{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}{{#supportAsync}}.thenApply(obj -> { {{/supportAsync}}{{/returnType}}{{^supportAsync}};{{/supportAsync}}{{#supportAsync}}{{^returnType}};{{/returnType}}{{/supportAsync}}
{{#returnType}}
{{^isResponseFile}}
{{^returnTypeIsPrimitive}}
{{#useBeanValidation}}
{{^supportAsync}}
if (configuration.getBoolean("useOutputBeanValidation")) {
{{#isArray}}
for ({{{returnType}}} curItem : obj) {
OpenAPIUtils.validate(curItem);
}
{{/isArray}}
{{#isMap}}
for (Map.Entry<String, {{{returnType}}}> entry : obj.entrySet()) {
OpenAPIUtils.validate(entry.getValue());
}
{{/isMap}}
{{^returnContainer}}
if (configuration.getBoolean("useOutputBeanValidation")) {
{{#isArray}}
for ({{{returnType}}} curItem : obj) {
OpenAPIUtils.validate(curItem);
}
{{/isArray}}
{{#isMap}}
for (Map.Entry<String, {{{returnType}}}> entry : obj.entrySet()) {
OpenAPIUtils.validate(entry.getValue());
}
{{/isMap}}
{{^returnContainer}}
OpenAPIUtils.validate(obj);
{{/returnContainer}}
}
{{/supportAsync}}
{{#supportAsync}}
if (configuration.getBoolean("useOutputBeanValidation")) {
{{#isArray}}
for ({{{returnType}}} curItem : obj) {
OpenAPIUtils.validate(curItem);
{{/returnContainer}}
}
{{/isArray}}
{{#isMap}}
for (Map.Entry<String, {{{returnType}}}> entry : obj.entrySet()) {
OpenAPIUtils.validate(entry.getValue());
}
{{/isMap}}
{{^returnContainer}}
OpenAPIUtils.validate(obj);
{{/returnContainer}}
}
{{/supportAsync}}
{{/useBeanValidation}}
{{/returnTypeIsPrimitive}}
{{/isResponseFile}}
{{#supportAsync}}
return obj;
});
return obj;
});
{{/supportAsync}}
{{/returnType}}
{{#returnType}}
@ -57,11 +48,13 @@ CompletableFuture<Result> result = CompletableFuture.supplyAsync(() -> {
return stage.thenApply(obj -> {
{{/supportAsync}}
{{^isResponseFile}}
{{#supportAsync}} {{/supportAsync}}JsonNode result = mapper.valueToTree(obj);
{{#supportAsync}} {{/supportAsync}}return ok(result);
{{#supportAsync}} {{/supportAsync}} JsonNode result = mapper.valueToTree(obj);
{{#supportAsync}} {{/supportAsync}} return ok(result);
{{/isResponseFile}}
{{#isResponseFile}}
{{#supportAsync}} {{/supportAsync}}return ok(obj);
{{#supportAsync}} {{/supportAsync}} return ok(obj);
{{/isResponseFile}}
{{/returnType}}
{{^returnType}}
@ -74,15 +67,15 @@ return stage.thenApply(obj -> {
return result;
{{/supportAsync}}
{{^supportAsync}}
return ok();
return ok();
{{/supportAsync}}
{{/returnType}}
{{#returnType}}
{{#supportAsync}}
});
});
{{/supportAsync}}
{{/returnType}}
{{/controllerOnly}}
{{#controllerOnly}}
return ok();
return ok();
{{/controllerOnly}}

View File

@ -0,0 +1,173 @@
package openapitools;
import com.auth0.jwk.Jwk;
import com.auth0.jwk.UrlJwkProvider;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.typesafe.config.Config;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import play.mvc.Http;
import java.net.URL;
import java.security.PublicKey;
import java.security.interfaces.RSAPublicKey;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
@Singleton
public class SecurityAPIUtils {
private final String bearerPrefix = "Bearer ";
private final ObjectMapper mapper;
private boolean useOnlineValidation = false;
// Online validation
private HashMap<String, String> tokenIntrospectEndpoints = new HashMap<>();
private final String clientId;
private final String clientSecret;
// Offline validation
private HashMap<String, String> jwksEndpoints = new HashMap<>();
private String tokenKeyId = "";
private JWTVerifier tokenVerifier; //Reusable verifier instance until tokenKeyId changes.
@Inject
SecurityAPIUtils(Config configuration) {
mapper = new ObjectMapper();
clientId = configuration.hasPath("oauth.clientId") ? configuration.getString("oauth.clientId") : "";
clientSecret = configuration.hasPath("oauth.clientSecret") ? configuration.getString("oauth.clientSecret") : "";
{{#hasOAuthMethods}}
{{#oauthMethods}}
tokenIntrospectEndpoints.put("{{name}}", "{{tokenIntrospectUrl}}");
{{/oauthMethods}}
{{/hasOAuthMethods}}
{{#hasOAuthMethods}}
{{#oauthMethods}}
jwksEndpoints.put("{{name}}", "{{jwksUrl}}");
{{/oauthMethods}}
{{/hasOAuthMethods}}
}
private boolean isRequestTokenValidByOnlineCheck(Http.Request request, String securityMethodName) {
try {
Optional<String> authToken = request.getHeaders().get(HttpHeaders.AUTHORIZATION);
if (authToken.isPresent()) {
String tokenWithoutBearerPrefix = authToken.get().substring(bearerPrefix.length());
HttpClientBuilder builder = HttpClientBuilder.create();
HttpClient httpClient = builder.build();
HttpPost httppost = new HttpPost(this.tokenIntrospectEndpoints.get(securityMethodName));
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("token", tokenWithoutBearerPrefix));
params.add(new BasicNameValuePair("client_id", clientId));
params.add(new BasicNameValuePair("client_secret", clientSecret));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse response = httpClient.execute(httppost);
String responseJsonString = EntityUtils.toString(response.getEntity());
HashMap responseJsonObject = mapper.readValue(responseJsonString, HashMap.class);
return response.getStatusLine().getStatusCode() == HttpStatus.SC_OK && (boolean) responseJsonObject.get("active");
}
} catch (Exception exception) {
return false;
}
return false;
}
private boolean isRequestTokenValidByOfflineCheck(Http.Request request, String securityMethodName) {
try {
Optional<String> authHeader = request.getHeaders().get(HttpHeaders.AUTHORIZATION);
if (authHeader.isPresent()) {
String bearerToken = authHeader.get().substring(bearerPrefix.length());
return isTokenValidByOfflineCheck(bearerToken, securityMethodName);
}
} catch (Exception exception) {
return false;
}
return false;
}
public boolean isTokenValidByOfflineCheck(String bearerToken, String securityMethodName) {
try {
DecodedJWT jwt = JWT.decode(bearerToken);
String issuer = jwt.getIssuer();
String keyId = jwt.getKeyId();
if (!tokenKeyId.equals(keyId)) {
if (securityMethodName == null) {
securityMethodName = jwksEndpoints.keySet().stream().findFirst().get();
}
Jwk jwk = new UrlJwkProvider(new URL(this.jwksEndpoints.get(securityMethodName))).get(keyId);
final PublicKey publicKey = jwk.getPublicKey();
if (!(publicKey instanceof RSAPublicKey)) {
throw new IllegalArgumentException(String.format("Key with ID %s was found in JWKS but is not a RSA-key.", keyId));
}
Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) publicKey, null);
tokenVerifier = JWT.require(algorithm)
.withIssuer(issuer)
.build();
tokenKeyId = keyId;
}
DecodedJWT verifiedJWT = tokenVerifier.verify(bearerToken);
return true;
} catch (Exception exception) {
return false;
}
}
public String getOAuthUserIdFromRequestToken(Http.Request requestWithPreviouslyVerifiedToken) {
try {
Optional<String> authHeader = requestWithPreviouslyVerifiedToken.getHeaders().get(HttpHeaders.AUTHORIZATION);
if (authHeader.isPresent()) {
String bearerToken = authHeader.get().substring(bearerPrefix.length());
return getOAuthUserIdFromToken(bearerToken);
}
} catch (Exception exception) {
return null;
}
return null;
}
public String getOAuthUserIdFromToken(String bearerToken) {
try {
DecodedJWT jwt = JWT.decode(bearerToken);
return jwt.getSubject();
} catch (Exception exception) {
return null;
}
}
public boolean isRequestTokenValid(Http.Request request, String securityMethodName) {
return useOnlineValidation ? isRequestTokenValidByOnlineCheck(request, securityMethodName) : isRequestTokenValidByOfflineCheck(request, securityMethodName);
}
}

View File

@ -0,0 +1 @@
{{#allowableValues}}allowableValues ={{#oas3}} { {{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}} }{{/oas3}}{{^oas3}} "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/oas3}}{{/allowableValues}}

View File

@ -10,9 +10,9 @@ package {{package}};
{{#oas3}}
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -120,29 +120,62 @@ public interface {{classname}} {
@ApiVirtual
{{/virtualService}}
{{#oas3}}
@Operation(summary = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }, responses = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}}{{/responses}} }{{#hasAuthMethods}},security = {
{{#authMethods}}@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} } {{/hasAuthMethods}})
{{/oas3}}{{^oas3}}
@ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = {
{{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},
{{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}}
{{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}}
{{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} })
@Operation(
summary = "{{{summary}}}",
tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
responses = {
{{#responses}}
@ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}}
{{/responses}}
}{{#hasAuthMethods}},
security = {
{{#authMethods}}
@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}
{{/authMethods}}
}{{/hasAuthMethods}}
)
{{/oas3}}
{{^oas3}}
@ApiOperation(
tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
value = "{{{summary}}}",
nickname = "{{{operationId}}}",
notes = "{{{notes}}}"{{#returnBaseType}},
response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}},
responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}},
authorizations = {
{{#authMethods}}
{{#isOAuth}}
@Authorization(value = "{{name}}", scopes = {
{{#scopes}}
@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}}
}){{^-last}},{{/-last}}
{{/isOAuth}}
{{^isOAuth}}
@Authorization(value = "{{name}}"){{^-last}},{{/-last}}
{{/isOAuth}}
{{/authMethods}} }{{/hasAuthMethods}}
)
@ApiResponses({
{{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}
{{/responses}}
})
{{/oas3}}
{{#implicitHeaders}}
{{#oas3}}
@Parameters({
{{#headerParams}}
{{>paramDoc}}{{^-last}},{{/-last}}
{{/headerParams}}
{{/oas3}}
{{^oas3}}
@ApiImplicitParams({
{{#headerParams}}
{{>implicitHeader}}{{^-last}},{{/-last}}
{{/headerParams}}
{{/oas3}}
{{#headerParams}}
{{>implicitHeader}}
{{/headerParams}}
})
{{/implicitHeaders}}
@RequestMapping(
@ -153,13 +186,18 @@ public interface {{classname}} {
produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}},
consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}}
)
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} {
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}(
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
{{/hasParams}}{{#oas3}}@Parameter(hidden = true){{/oas3}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
{{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore {{/useSpringfox}}final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}
){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} {
{{#delegate-method}}
return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}});
}
// Override this method
{{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
{{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
{{/delegate-method}}
{{^isDelegate}}
{{>methodBody}}

View File

@ -3,7 +3,18 @@ package {{package}};
{{^jdk8}}
{{#imports}}import {{import}};
{{/imports}}
{{#oas3}}
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
{{/oas3}}
{{^oas3}}
import io.swagger.annotations.*;
{{/oas3}}
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -118,7 +129,11 @@ public class {{classname}}Controller implements {{classname}} {
{{/externalDocs}}
* @see {{classname}}#{{operationId}}
*/
public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}, @springfox.documentation.annotations.ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}) {
public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}(
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
{{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
{{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore {{/useSpringfox}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
) {
{{^isDelegate}}
{{^async}}
{{>methodBody}}

View File

@ -2,7 +2,6 @@ package {{package}};
{{#imports}}import {{import}};
{{/imports}}
import io.swagger.annotations.*;
{{#vendorExtensions.x-spring-paginated}}
import org.springframework.data.domain.Pageable;
{{/vendorExtensions.x-spring-paginated}}
@ -73,7 +72,7 @@ public interface {{classname}}Delegate {
*/
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
{{>methodBody}}
}{{/jdk8-default-interface}}

View File

@ -1 +1 @@
{{#isBodyParam}}{{#oas3}}@Parameter(name ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}} {{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{{.}}}"{{#oas3}}){{/oas3}}{{/allowableValues}}) {{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}}
{{#isBodyParam}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}}

View File

@ -1 +1 @@
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}}
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isCookieParam}}

View File

@ -0,0 +1 @@
{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}}

View File

@ -1 +1 @@
{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}}
{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}}

View File

@ -1 +1 @@
{{#isHeaderParam}}{{#oas3}}@Parameter(description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}}
{{#isHeaderParam}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}}

View File

@ -1 +1 @@
{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}}{{/isHeaderParam}}
{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{/isHeaderParam}}

View File

@ -10,7 +10,10 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
{{#useSpringfox}}
<springfox-version>2.9.2</springfox-version>
<springfox.version>2.9.2</springfox.version>
{{/useSpringfox}}
{{^useSpringfox}}
<swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
{{/useSpringfox}}
</properties>
{{#parentOverridden}}
@ -24,7 +27,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>{{#java8}}2.3.3.RELEASE{{/java8}}{{^java8}}1.5.12.RELEASE{{/java8}}</version>
<version>2.5.8</version>
</parent>
{{/parentOverridden}}
<build>
@ -34,13 +37,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
{{#apiFirst}}
<plugin>
@ -91,43 +87,25 @@
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${springfox.version}</version>
</dependency>
{{/useSpringfox}}
{{^useSpringfox}}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.14.2</version>
</dependency>
{{#oas3}}
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.2</version>
<version>${swagger-core-version}</version>
</dependency>
{{/oas3}}
{{^oas3}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.14</version>
<version>${swagger-core-version}</version>
</dependency>
{{/oas3}}
{{/useSpringfox}}
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
@ -138,9 +116,12 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
{{/useSpringfox}}
{{#withXml}}
<!-- XML processing: Jackson -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
@ -162,21 +143,21 @@
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>2.8.4</version>
<version>2.9.10</version>
</dependency>
{{/threetenbp}}
{{#openApiNullable}}
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
</dependency>
{{/openApiNullable}}
{{#useBeanValidation}}
<!-- Bean Validation API support -->
<!-- Bean Validation API support -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
{{/useBeanValidation}}
{{#virtualService}}

View File

@ -1 +1 @@
{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}}
{{#isFormParam}}{{^isFile}}{{>paramDoc}} @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}}

View File

@ -9,7 +9,10 @@
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version>
<swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
{{#useSpringfox}}
<springfox.version>2.9.2</springfox.version>
{{/useSpringfox}}
</properties>
{{#parentOverridden}}
<parent>
@ -22,7 +25,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<version>2.6.2</version>
</parent>
{{/parentOverridden}}
<build>
@ -35,7 +38,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2020.0.4</version>
<version>2021.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -44,27 +47,37 @@
{{/parentOverridden}}
<dependencies>
{{#useSpringfox}}
<!--SpringFox dependencies -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
{{/useSpringfox}}
{{^useSpringfox}}
{{#oas3}}
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.2</version>
<version>${swagger-core-version}</version>
</dependency>
{{/oas3}}
{{^oas3}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
{{^parentOverridden}}
<version>${swagger-core-version}</version>
{{/parentOverridden}}
</dependency>
{{/oas3}}
{{/useSpringfox}}
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
{{^parentOverridden}}
<version>3.0.2</version>
{{/parentOverridden}}
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
@ -73,7 +86,9 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
{{^parentOverridden}}
<version>2.2.5.RELEASE</version>
{{/parentOverridden}}
</dependency>
{{#withXml}}
<!-- XML processing: Jackson -->
@ -107,40 +122,31 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
{{^parentOverridden}}
<version>0.2.1</version>
{{/parentOverridden}}
{{^parentOverridden}}
<version>0.2.2</version>
{{/parentOverridden}}
</dependency>
{{/openApiNullable}}
{{#hateoas}}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
{{/hateoas}}
{{#useBeanValidation}}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
{{/useBeanValidation}}
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
{{#hateoas}}
<!-- Spring HATEOAS -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
{{/hateoas}}
{{#useBeanValidation}}
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
{{^parentOverridden}}
<version>6.0.16.Final</version>
{{/parentOverridden}}
</dependency>
{{/useBeanValidation}}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -187,14 +187,14 @@
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.2</version>
<version>${swagger-core-version}</version>
</dependency>
{{/oas3}}
{{^oas3}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.14</version>
<version>${swagger-core-version}</version>
</dependency>
{{/oas3}}
<!-- @Nullable annotation -->
@ -289,12 +289,12 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<jakarta.xml.bind-version>2.3.3</jakarta.xml.bind-version>
<jakarta.xml.bind-version>2.3.3</jakarta.xml.bind-version>
<jetty-version>9.2.15.v20160210</jetty-version>
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.13.1</junit-version>
<servlet-api-version>4.0.4</servlet-api-version>
<springfox-version>2.8.0</springfox-version>
<springfox-version>2.9.2</springfox-version>
<jackson-version>2.9.9</jackson-version>
<jackson-threetenbp-version>2.8.4</jackson-threetenbp-version>
{{#useBeanValidation}}
@ -305,5 +305,6 @@
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
{{/openApiNullable}}
<jackson-databind-version>2.9.8</jackson-databind-version>
<swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
</properties>
</project>

View File

@ -0,0 +1 @@
{{#oas3}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/oas3}}{{^oas3}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/oas3}}

View File

@ -1 +1 @@
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{baseName}}", description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaRemoveDoubleQuote}}{{{value}}}{{/lambdaRemoveDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}

View File

@ -1 +1 @@
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{#oas3}}){{/oas3}}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}}
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}}

View File

@ -28,6 +28,11 @@ import java.util.Map;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.JAVA8_MODE;
import static org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen.USE_TAGS;
import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.INTERFACE_ONLY;
import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.SUPPORT_ASYNC;
import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.RETURN_RESPONSE;
import static org.testng.Assert.assertTrue;
/**
@ -95,6 +100,8 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.iiii.invoker");
codegen.additionalProperties().put("serverPort", "8088");
codegen.additionalProperties().put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "openapi.yml");
codegen.additionalProperties().put(SUPPORT_ASYNC, true);
codegen.additionalProperties().put(JAVA8_MODE, false);
codegen.processOpts();
OpenAPI openAPI = new OpenAPI();
@ -112,6 +119,8 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaJAXRSServerCodegen.SERVER_PORT), "8088");
Assert.assertEquals(codegen.getOpenApiSpecFileLocation(), "openapi.yml");
Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION), "openapi.yml");
Assert.assertEquals(codegen.additionalProperties().get(SUPPORT_ASYNC), "true");
Assert.assertEquals(codegen.additionalProperties().get(JAVA8_MODE), true); //overridden by supportAsync=true
}
/**
@ -419,4 +428,170 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
assertFileContains(path, "\nimport java.util.Set;\n");
}
@Test
public void generateApiWithAsyncSupport() throws Exception {
final File output = Files.createTempDirectory("test").toFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/ping.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //Using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated class contains CompletionStage<Response>
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"\nimport java.util.concurrent.CompletableFuture;\n",
"\npublic CompletionStage<Response> pingGet() {\n",
"\nCompletableFuture.supplyAsync(() -> Response.ok().entity(\"magic!\").build())\n"
);
}
@Test
public void generateApiWithAsyncSupportAndInterfaceOnly() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/ping.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled
codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //Using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interface contains CompletionStage<Void>
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"\nCompletionStage<Void> pingGet();\n");
}
@Test
public void generateApiWithAsyncSupportAndInterfaceOnlyAndResponse() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/ping.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled
codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated
codegen.additionalProperties().put(RETURN_RESPONSE, true); //And return type is Response
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //Using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interface contains CompletionStage<Response>
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java");
assertFileContains(output.toPath().resolve( "src/gen/java/org/openapitools/api/PingApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"\nCompletionStage<Response> pingGet();\n");
}
@Test
public void generatePetstoreAPIWithAsyncSupport() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled
codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interfaces contains CompletionStage
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"CompletionStage<Void> deletePet", //Support empty response
"CompletionStage<List<Pet>> findPetsByStatus", //Support type of arrays response
"CompletionStage<Pet> getPetById" //Support single type response
);
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/StoreApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/StoreApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"CompletionStage<Map<String, Integer>>" //Support map response
);
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/UserApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/UserApi.java"),
"\nimport java.util.concurrent.CompletionStage;\n",
"CompletionStage<String>" //Support simple types
);
}
@Test
public void generatePingWithAsyncSupportPrimitiveType() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/issue_4832.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled
codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated
codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in PingApi.java
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interfaces contains CompletionStage with proper classes instead of primitive types
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java");
TestUtils.assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"),
"CompletionStage<Boolean> pingGetBoolean", //Support primitive types response
"CompletionStage<Integer> pingGetInteger" //Support primitive types response
);
}
}

View File

@ -1,3 +1,4 @@
/*
package org.openapitools.codegen.markdown;
import java.io.File;
@ -51,3 +52,4 @@ public class MarkdownSampleGeneratorTest {
}
}
*/

View File

@ -0,0 +1,100 @@
package org.openapitools.codegen.scala;
import com.google.common.collect.ImmutableList;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.openapitools.codegen.languages.ScalaGatlingCodegen;
import static org.testng.Assert.assertEquals;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.stream.Collectors;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.DateTimeSchema;
import io.swagger.v3.oas.models.media.IntegerSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.parser.util.SchemaTypeUtil;
public class ScalaGatlingCodegenTest {
private final ScalaGatlingCodegen codegen = new ScalaGatlingCodegen();
@Test
public void happyPath() throws IOException {
assertEquals(codegen.getName(), "scala-gatling");
assertEquals(codegen.getTag(), CodegenType.CLIENT);
final List<String> filenames = codegen.supportingFiles().stream()
.map(supportingFile -> supportingFile.getDestinationFilename())
.collect(Collectors.toList());
assertEquals(filenames, ImmutableList.of(
"build.gradle",
"logback.xml",
"default.conf",
"CI.conf",
"CD.conf",
"stress.conf",
"baseline.conf",
"longevity.conf"));
final Schema model = new Schema()
.description("a sample model")
.addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
.addProperties("name", new StringSchema())
.addProperties("createdAt", new DateTimeSchema())
.addRequiredItem("id")
.addRequiredItem("name");
final OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
final CodegenModel cm = codegen.fromModel("sample", model);
assertEquals(cm.name, "sample");
assertEquals(cm.classname, "Sample");
assertEquals(cm.description, "a sample model");
assertEquals(cm.vars.size(), 3);
File output = Files.createTempDirectory("test").toFile();
output.deleteOnExit();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName(codegen.getName())
.setInputSpec("src/test/resources/3_0/scala_reserved_words.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
final ClientOptInput clientOptInput = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
generator.setGenerateMetadata(false);
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true");
List<File> files = generator.opts(clientOptInput).generate();
assertEquals(files.size(), 9);
TestUtils.ensureContainsFile(files, output, "src/gatling/scala/org/openapitools/client/model/SomeObj.scala");
TestUtils.ensureContainsFile(files, output, "build.gradle");
TestUtils.ensureContainsFile(files, output, "src/gatling/resources/conf/logback.xml");
TestUtils.ensureContainsFile(files, output, "src/gatling/resources/conf/baseline.conf");
TestUtils.ensureContainsFile(files, output, "src/gatling/resources/conf/stress.conf");
TestUtils.ensureContainsFile(files, output, "src/gatling/resources/conf/longevity.conf");
}
}

View File

@ -0,0 +1,254 @@
swagger: '2.0'
info:
description: 'This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.'
version: 1.0.0
title: OpenAPI Petstore
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2
tags:
- name: pet
description: Everything about your Pets
- name: store
description: Access to Petstore orders
- name: user
description: Operations about user
schemes:
- http
paths:
/pet:
post:
tags:
- pet
summary: Add a new pet to the store
description: ''
operationId: addPet
consumes:
- application/json
- application/xml
produces:
- application/xml
- application/json
parameters:
- in: body
name: body
description: Pet object that needs to be added to the store
required: true
schema:
$ref: '#/definitions/Pet'
responses:
'405':
description: Invalid input
security:
- petstore_token: [base]
put:
tags:
- pet
summary: Update an existing pet
description: ''
operationId: updatePet
consumes:
- application/json
- application/xml
produces:
- application/xml
- application/json
parameters:
- in: body
name: body
description: Pet object that needs to be added to the store
required: true
schema:
$ref: '#/definitions/Pet'
responses:
'400':
description: Invalid ID supplied
'404':
description: Pet not found
'405':
description: Validation exception
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
/pet/findByStatus:
get:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
produces:
- application/xml
- application/json
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: true
type: array
items:
type: string
enum:
- available
- pending
- sold
default: available
collectionFormat: csv
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Pet'
'400':
description: Invalid status value
securityDefinitions:
petstore_token:
type: oauth2
description: security definition for using keycloak authentification with control site.
authorizationUrl: https://keycloak-dev.business.stingray.com/auth/realms/CSLocal/protocol/openid-connect/auth
tokenUrl: https://keycloak-dev.business.stingray.com/auth/realms/CSLocal/protocol/openid-connect/token
x-jwksUrl: https://keycloak-dev.business.stingray.com/auth/realms/CSLocal/protocol/openid-connect/certs
x-tokenIntrospectUrl: https://keycloak-dev.business.stingray.com/auth/realms/CSLocal/protocol/openid-connect/token/introspect
flow: accessCode
scopes:
base: not sure if we will be using scopes, at least in the beginning, but since we need to specify one....
api_key:
type: apiKey
name: api_key
in: header
definitions:
Order:
title: Pet Order
description: An order for a pets from the pet store
type: object
properties:
id:
type: integer
format: int64
petId:
type: integer
format: int64
quantity:
type: integer
format: int32
shipDate:
type: string
format: date-time
status:
type: string
description: Order Status
enum:
- placed
- approved
- delivered
complete:
type: boolean
default: false
xml:
name: Order
Category:
title: Pet category
description: A category for a pet
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: Category
User:
title: a User
description: A User who is purchasing from the pet store
type: object
properties:
id:
type: integer
format: int64
username:
type: string
firstName:
type: string
lastName:
type: string
email:
type: string
password:
type: string
phone:
type: string
userStatus:
type: integer
format: int32
description: User Status
xml:
name: User
Tag:
title: Pet Tag
description: A tag for a pet
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: Tag
Pet:
title: a Pet
description: A pet for sale in the pet store
type: object
required:
- name
- photoUrls
properties:
id:
type: integer
format: int64
category:
$ref: '#/definitions/Category'
name:
type: string
example: doggie
photoUrls:
type: array
xml:
name: photoUrl
wrapped: true
items:
type: string
tags:
type: array
xml:
name: tag
wrapped: true
items:
$ref: '#/definitions/Tag'
status:
type: string
description: pet status in the store
enum:
- available
- pending
- sold
xml:
name: Pet
ApiResponse:
title: An uploaded response
description: Describes the result of uploading an image resource
type: object
properties:
code:
type: integer
format: int32
type:
type: string
message:
type: string

View File

@ -0,0 +1,31 @@
openapi: 3.0.1
info:
title: ping that return primitive types
version: '1.0'
servers:
- url: 'http://localhost:8082/'
paths:
/pingBoolean:
get:
operationId: pingGetBoolean
tags: [Ping]
responses:
'200':
description: OK
content:
'application/json':
schema:
type: boolean
/pingInteger:
get:
operationId: pingGetInteger
tags: [Ping]
responses:
'200':
description: OK
content:
'application/json':
schema:
type: integer
format: int32

View File

@ -0,0 +1,70 @@
openapi: 3.0.3
info:
title: Api Documentation
description: 'Demo Spring Mvc @DateTimeFormat across the different openapi parameter types'
version: '1.0'
paths:
/thingy/{date}:
post:
description: 'update with form data'
operationId: updatePetWithForm
parameters:
- name: date
in: path
description: 'A date path parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
responses:
'405':
description: Invalid input
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
visitDate:
description: Updated last vist timestamp
type: string
format: date-time
get:
operationId: get
parameters:
- name: date
in: path
description: 'A date path parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
- name: dateTime
description: 'A date-time query parameter'
in: query
required: true
schema:
type: string
format: date-time
example: '1996-12-19T16:39:57-08:00'
- name: X-Order-Date
in: header
description: 'A date header parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
- name: loginDate
in: cookie
description: 'A date cookie parameter'
required: false
schema:
type: string
format: date
example: '2021-01-01'
responses:
'200':
description: OK

46
pom.xml
View File

@ -3,6 +3,7 @@
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>5</version>
<relativePath/><!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
@ -1208,15 +1209,21 @@
<module>samples/server/petstore/jaxrs-resteasy/joda</module>
<module>samples/server/petstore/jaxrs-resteasy/default-value</module>
<!--<module>samples/server/petstore/kotlin-server/ktor</module>-->
<!-- move to other CI as the following fails often in CircleCI
<module>samples/server/petstore/spring-mvc</module>
<module>samples/server/petstore/spring-mvc-j8-async</module>
<module>samples/server/petstore/spring-mvc-j8-localdatetime</module>-->
<module>samples/client/petstore/spring-cloud</module>
<module>samples/openapi3/client/petstore/spring-cloud</module>
<module>samples/client/petstore/spring-cloud-date-time</module>
<module>samples/openapi3/client/petstore/spring-cloud-date-time</module>
<module>samples/server/petstore/springboot</module>
<module>samples/openapi3/server/petstore/springboot</module>
<module>samples/server/petstore/springboot-beanvalidation</module>
<module>samples/server/petstore/springboot-useoptional</module>
<module>samples/openapi3/server/petstore/springboot-useoptional</module>
<module>samples/server/petstore/springboot-reactive</module>
<module>samples/openapi3/server/petstore/springboot-reactive</module>
<module>samples/server/petstore/springboot-implicitHeaders</module>
<module>samples/openapi3/server/petstore/springboot-implicitHeaders</module>
<module>samples/server/petstore/springboot-delegate</module>
<module>samples/openapi3/server/petstore/springboot-delegate</module>
<module>samples/server/petstore/jaxrs-cxf</module>
<module>samples/server/petstore/jaxrs-cxf-annotated-base-path</module>
<module>samples/server/petstore/jaxrs-cxf-cdi</module>
@ -1230,6 +1237,37 @@
<module>samples/server/petstore/scala-finch</module>
</modules>
</profile>
<profile>
<id>samples.circleci.spring</id>
<activation>
<property>
<name>env</name>
<value>samples.circleci.spring</value>
</property>
</activation>
<modules>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/server/petstore/spring-mvc-default-value</module>
<module>samples/server/petstore/spring-mvc-j8-async</module>
<module>samples/server/petstore/spring-mvc-j8-localdatetime</module>
<!-- servers -->
<module>samples/client/petstore/spring-cloud</module>
<module>samples/openapi3/client/petstore/spring-cloud</module>
<module>samples/client/petstore/spring-cloud-date-time</module>
<module>samples/openapi3/client/petstore/spring-cloud-date-time</module>
<module>samples/server/petstore/springboot</module>
<module>samples/openapi3/server/petstore/springboot</module>
<module>samples/server/petstore/springboot-beanvalidation</module>
<module>samples/server/petstore/springboot-useoptional</module>
<module>samples/openapi3/server/petstore/springboot-useoptional</module>
<module>samples/server/petstore/springboot-reactive</module>
<module>samples/openapi3/server/petstore/springboot-reactive</module>
<module>samples/server/petstore/springboot-implicitHeaders</module>
<module>samples/openapi3/server/petstore/springboot-implicitHeaders</module>
<module>samples/server/petstore/springboot-delegate</module>
<module>samples/openapi3/server/petstore/springboot-delegate</module>
</modules>
</profile>
<!-- node 3 tests in CircleCI -->
<profile>
<id>samples.circleci.node3</id>

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -123,7 +123,7 @@ public class PingApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -133,7 +133,7 @@ public class AnotherFakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -141,7 +141,7 @@ public class FakeApi {
"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -272,7 +272,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -402,7 +402,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -532,7 +532,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -662,7 +662,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -792,7 +792,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -925,7 +925,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1064,7 +1064,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1269,7 +1269,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1479,7 +1479,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1623,7 +1623,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1844,7 +1844,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1984,7 +1984,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -2132,7 +2132,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -133,7 +133,7 @@ public class FakeClassnameTags123Api {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -137,7 +137,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -275,7 +275,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -414,7 +414,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -556,7 +556,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -704,7 +704,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -848,7 +848,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -999,7 +999,7 @@ public class PetApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1147,7 +1147,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1299,7 +1299,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -135,7 +135,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -268,7 +268,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -398,7 +398,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -540,7 +540,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -134,7 +134,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -265,7 +265,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -396,7 +396,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -529,7 +529,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -666,7 +666,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -811,7 +811,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -956,7 +956,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1082,7 +1082,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -91,7 +91,7 @@ public class AnotherFakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -90,7 +90,7 @@ public class DefaultApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -98,7 +98,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -209,7 +209,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -323,7 +323,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -437,7 +437,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -551,7 +551,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -664,7 +664,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -780,7 +780,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -897,7 +897,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1086,7 +1086,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1292,7 +1292,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1432,7 +1432,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1631,7 +1631,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1749,7 +1749,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1890,7 +1890,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -91,7 +91,7 @@ public class FakeClassnameTags123Api {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -93,7 +93,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -208,7 +208,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -325,7 +325,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -454,7 +454,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -586,7 +586,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -713,7 +713,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -839,7 +839,7 @@ public class PetApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -965,7 +965,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1101,7 +1101,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -93,7 +93,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -204,7 +204,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -318,7 +318,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -444,7 +444,7 @@ public class StoreApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -92,7 +92,7 @@ public class UserApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -201,7 +201,7 @@ public class UserApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -310,7 +310,7 @@ public class UserApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -421,7 +421,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -536,7 +536,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -671,7 +671,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -800,7 +800,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -904,7 +904,7 @@ public class UserApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -122,7 +122,7 @@ public class AnotherFakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -130,7 +130,7 @@ public class FakeApi {
"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -253,7 +253,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -375,7 +375,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -497,7 +497,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -619,7 +619,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -741,7 +741,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -869,7 +869,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1000,7 +1000,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1197,7 +1197,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1417,7 +1417,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1571,7 +1571,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1784,7 +1784,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1916,7 +1916,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -2071,7 +2071,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -122,7 +122,7 @@ public class FakeClassnameTags123Api {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -126,7 +126,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -259,7 +259,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -393,7 +393,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -530,7 +530,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -670,7 +670,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -806,7 +806,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -949,7 +949,7 @@ public class PetApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1089,7 +1089,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1233,7 +1233,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -124,7 +124,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -249,7 +249,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -371,7 +371,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -505,7 +505,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -123,7 +123,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -246,7 +246,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -369,7 +369,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -494,7 +494,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -623,7 +623,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -766,7 +766,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -903,7 +903,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1021,7 +1021,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -122,7 +122,7 @@ public class AnotherFakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -130,7 +130,7 @@ public class FakeApi {
"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -253,7 +253,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -375,7 +375,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -497,7 +497,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -619,7 +619,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -741,7 +741,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -869,7 +869,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1000,7 +1000,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1197,7 +1197,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1417,7 +1417,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1571,7 +1571,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1784,7 +1784,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1916,7 +1916,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -2071,7 +2071,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -122,7 +122,7 @@ public class FakeClassnameTags123Api {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -126,7 +126,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -259,7 +259,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -393,7 +393,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -530,7 +530,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -670,7 +670,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -806,7 +806,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -949,7 +949,7 @@ public class PetApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1089,7 +1089,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1233,7 +1233,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -124,7 +124,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -249,7 +249,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -371,7 +371,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -505,7 +505,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -123,7 +123,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -246,7 +246,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -369,7 +369,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -494,7 +494,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -623,7 +623,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -766,7 +766,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -903,7 +903,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@ -1021,7 +1021,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null) {
if (localVarHeaderParams != null && localVarContentTypes != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

View File

@ -52,10 +52,6 @@ public class Pair {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}

Some files were not shown because too many files have changed in this diff Show More