mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 02:25:20 +00:00
[Java] Retrofit2 Play! Framework 2.6.x support (#901)
* added play framework 2.6 support * generated petstore sample * generated petstore sample #2 * generated petstore sample #3 * Revert "generated petstore sample #3" * generated petstore sample #4 * fixed circleci configs * one more time samples regen
This commit is contained in:
parent
5926ee5f1f
commit
4558e49c7e
@ -899,6 +899,7 @@
|
|||||||
<module>samples/client/petstore/java/retrofit2</module>
|
<module>samples/client/petstore/java/retrofit2</module>
|
||||||
<module>samples/client/petstore/java/retrofit2rx</module>
|
<module>samples/client/petstore/java/retrofit2rx</module>
|
||||||
<module>samples/client/petstore/java/retrofit2-play25</module>
|
<module>samples/client/petstore/java/retrofit2-play25</module>
|
||||||
|
<module>samples/client/petstore/java/retrofit2-play26</module>
|
||||||
<module>samples/client/petstore/jaxrs-cxf-client</module>
|
<module>samples/client/petstore/jaxrs-cxf-client</module>
|
||||||
<module>samples/client/petstore/java/resttemplate</module>
|
<module>samples/client/petstore/java/resttemplate</module>
|
||||||
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
||||||
|
1
bin/java-petstore-retrofit2-play26.json
Normal file
1
bin/java-petstore-retrofit2-play26.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"useBeanValidation":"true","enableBuilderSupport":"true","library":"retrofit2","usePlayWS":"true","playVersion":"play26"}
|
35
bin/java-petstore-retrofit2-play26.sh
Executable file
35
bin/java-petstore-retrofit2-play26.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate --artifact-id petstore-java-client-retrofit2-play26 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2-play26.json -o samples/client/petstore/java/retrofit2-play26 -DhideGenerationTimestamp=true $@"
|
||||||
|
|
||||||
|
echo "Removing files and folders under samples/client/petstore/java/retrofit2-play26/src/main"
|
||||||
|
rm -rf samples/client/petstore/java/retrofit2-play26/src/main
|
||||||
|
find samples/client/petstore/java/retrofit2-play26 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
|
|
||||||
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
|
|
||||||
import static java.util.Collections.sort;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
@ -43,12 +39,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
|
||||||
|
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
|
||||||
|
import static java.util.Collections.sort;
|
||||||
|
|
||||||
public class JavaClientCodegen extends AbstractJavaCodegen
|
public class JavaClientCodegen extends AbstractJavaCodegen
|
||||||
implements BeanValidationFeatures, PerformBeanValidationFeatures,
|
implements BeanValidationFeatures, PerformBeanValidationFeatures,
|
||||||
GzipFeatures {
|
GzipFeatures {
|
||||||
@ -67,6 +65,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
|
|
||||||
public static final String PLAY_24 = "play24";
|
public static final String PLAY_24 = "play24";
|
||||||
public static final String PLAY_25 = "play25";
|
public static final String PLAY_25 = "play25";
|
||||||
|
public static final String PLAY_26 = "play26";
|
||||||
|
|
||||||
public static final String FEIGN = "feign";
|
public static final String FEIGN = "feign";
|
||||||
public static final String GOOGLE_API_CLIENT = "google-api-client";
|
public static final String GOOGLE_API_CLIENT = "google-api-client";
|
||||||
@ -333,7 +332,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
supportingFiles.add(new SupportingFile("play24/Play24CallFactory.mustache", invokerFolder, "Play24CallFactory.java"));
|
supportingFiles.add(new SupportingFile("play24/Play24CallFactory.mustache", invokerFolder, "Play24CallFactory.java"));
|
||||||
supportingFiles.add(new SupportingFile("play24/Play24CallAdapterFactory.mustache", invokerFolder,
|
supportingFiles.add(new SupportingFile("play24/Play24CallAdapterFactory.mustache", invokerFolder,
|
||||||
"Play24CallAdapterFactory.java"));
|
"Play24CallAdapterFactory.java"));
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (PLAY_25.equals(playVersion)) {
|
||||||
additionalProperties.put(PLAY_25, true);
|
additionalProperties.put(PLAY_25, true);
|
||||||
apiTemplateFiles.put("play25/api.mustache", ".java");
|
apiTemplateFiles.put("play25/api.mustache", ".java");
|
||||||
|
|
||||||
@ -344,6 +345,17 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
additionalProperties.put("java8", "true");
|
additionalProperties.put("java8", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PLAY_26.equals(playVersion)) {
|
||||||
|
additionalProperties.put(PLAY_26, true);
|
||||||
|
apiTemplateFiles.put("play26/api.mustache", ".java");
|
||||||
|
|
||||||
|
supportingFiles.add(new SupportingFile("play26/ApiClient.mustache", invokerFolder, "ApiClient.java"));
|
||||||
|
supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java"));
|
||||||
|
supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder,
|
||||||
|
"Play26CallAdapterFactory.java"));
|
||||||
|
additionalProperties.put("java8", "true");
|
||||||
|
}
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("play-common/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
|
supportingFiles.add(new SupportingFile("play-common/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
|
||||||
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
|
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
|
||||||
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
|
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
|
||||||
|
@ -129,6 +129,10 @@ ext {
|
|||||||
jackson_version = "2.7.8"
|
jackson_version = "2.7.8"
|
||||||
play_version = "2.5.14"
|
play_version = "2.5.14"
|
||||||
{{/play25}}
|
{{/play25}}
|
||||||
|
{{#play26}}
|
||||||
|
jackson_version = "2.8.10"
|
||||||
|
play_version = "2.6.7"
|
||||||
|
{{/play26}}
|
||||||
{{/usePlayWS}}
|
{{/usePlayWS}}
|
||||||
swagger_annotations_version = "1.5.17"
|
swagger_annotations_version = "1.5.17"
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
@ -171,7 +175,13 @@ dependencies {
|
|||||||
compile "org.threeten:threetenbp:$threetenbp_version"
|
compile "org.threeten:threetenbp:$threetenbp_version"
|
||||||
{{/threetenbp}}
|
{{/threetenbp}}
|
||||||
{{#usePlayWS}}
|
{{#usePlayWS}}
|
||||||
|
{{#play26}}
|
||||||
|
compile "com.typesafe.play:play-ahc-ws_2.12:$play_version"
|
||||||
|
compile "javax.validation:validation-api:1.1.0.Final"
|
||||||
|
{{/play26}}
|
||||||
|
{{^play26}}
|
||||||
compile "com.typesafe.play:play-java-ws_2.11:$play_version"
|
compile "com.typesafe.play:play-java-ws_2.11:$play_version"
|
||||||
|
{{/play26}}
|
||||||
compile "com.squareup.retrofit2:converter-jackson:$retrofit_version"
|
compile "com.squareup.retrofit2:converter-jackson:$retrofit_version"
|
||||||
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||||
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||||
|
@ -27,6 +27,13 @@ lazy val root = (project in file(".")).
|
|||||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.8" % "compile",
|
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.8" % "compile",
|
||||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.8" % "compile",
|
"com.fasterxml.jackson.core" % "jackson-databind" % "2.7.8" % "compile",
|
||||||
{{/play25}}
|
{{/play25}}
|
||||||
|
{{#play26}}
|
||||||
|
"com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile",
|
||||||
|
"javax.validation" % "validation-api" % "1.1.0.Final" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.10" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.10" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.10" % "compile",
|
||||||
|
{{/play26}}
|
||||||
"com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile",
|
"com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile",
|
||||||
{{/usePlayWS}}
|
{{/usePlayWS}}
|
||||||
{{#useRxJava}}
|
{{#useRxJava}}
|
||||||
|
@ -0,0 +1,205 @@
|
|||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import retrofit2.Converter;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
import retrofit2.converter.scalars.ScalarsConverterFactory;
|
||||||
|
import retrofit2.converter.jackson.JacksonConverterFactory;
|
||||||
|
|
||||||
|
import play.libs.Json;
|
||||||
|
import play.libs.ws.WSClient;
|
||||||
|
|
||||||
|
import {{invokerPackage}}.Play26CallAdapterFactory;
|
||||||
|
import {{invokerPackage}}.Play26CallFactory;
|
||||||
|
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import {{invokerPackage}}.auth.ApiKeyAuth;
|
||||||
|
import {{invokerPackage}}.auth.Authentication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API client
|
||||||
|
*/
|
||||||
|
public class ApiClient {
|
||||||
|
|
||||||
|
/** Underlying HTTP-client */
|
||||||
|
private WSClient wsClient;
|
||||||
|
|
||||||
|
/** Creates HTTP call instances */
|
||||||
|
private Play26CallFactory callFactory;
|
||||||
|
|
||||||
|
/** Create {@link java.util.concurrent.CompletionStage} instances from HTTP calls */
|
||||||
|
private Play26CallAdapterFactory callAdapterFactory;
|
||||||
|
|
||||||
|
/** Supported auths */
|
||||||
|
private Map<String, Authentication> authentications;
|
||||||
|
|
||||||
|
/** API base path */
|
||||||
|
private String basePath = "{{{basePath}}}";
|
||||||
|
|
||||||
|
/** Default ObjectMapper */
|
||||||
|
private ObjectMapper defaultMapper;
|
||||||
|
|
||||||
|
public ApiClient(WSClient wsClient) {
|
||||||
|
this();
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient() {
|
||||||
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
|
authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}
|
||||||
|
// authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
|
||||||
|
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
|
||||||
|
// Prevent the authentications from being modified.
|
||||||
|
authentications = Collections.unmodifiableMap(authentications);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a retrofit2 client for given API interface
|
||||||
|
*/
|
||||||
|
public <S> S createService(Class<S> serviceClass) {
|
||||||
|
if(!basePath.endsWith("/")) {
|
||||||
|
basePath = basePath + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> extraHeaders = new HashMap<>();
|
||||||
|
List<Pair> extraQueryParams = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String authName : authentications.keySet()) {
|
||||||
|
Authentication auth = authentications.get(authName);
|
||||||
|
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
|
||||||
|
|
||||||
|
auth.applyToParams(extraQueryParams, extraHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callFactory == null) {
|
||||||
|
callFactory = new Play26CallFactory(wsClient, extraHeaders, extraQueryParams);
|
||||||
|
}
|
||||||
|
if (callAdapterFactory == null) {
|
||||||
|
callAdapterFactory = new Play26CallAdapterFactory();
|
||||||
|
}
|
||||||
|
if (defaultMapper == null) {
|
||||||
|
defaultMapper = Json.mapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Retrofit.Builder()
|
||||||
|
.baseUrl(basePath)
|
||||||
|
.addConverterFactory(new FileConverter())
|
||||||
|
.addConverterFactory(ScalarsConverterFactory.create())
|
||||||
|
.addConverterFactory(JacksonConverterFactory.create(defaultMapper))
|
||||||
|
.callFactory(callFactory)
|
||||||
|
.addCallAdapterFactory(callAdapterFactory)
|
||||||
|
.build()
|
||||||
|
.create(serviceClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API base path
|
||||||
|
*/
|
||||||
|
public ApiClient setBasePath(String basePath) {
|
||||||
|
this.basePath = basePath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get authentications (key: authentication name, value: authentication).
|
||||||
|
*/
|
||||||
|
public Map<String, Authentication> getAuthentications() {
|
||||||
|
return authentications;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get authentication for the given name.
|
||||||
|
*
|
||||||
|
* @param authName The authentication name
|
||||||
|
* @return The authentication, null if not found
|
||||||
|
*/
|
||||||
|
public Authentication getAuthentication(String authName) {
|
||||||
|
return authentications.get(authName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key value for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public ApiClient setApiKey(String apiKey) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKey(apiKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key prefix for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set HTTP call instances factory
|
||||||
|
*/
|
||||||
|
public ApiClient setCallFactory(Play26CallFactory callFactory) {
|
||||||
|
this.callFactory = callFactory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set {@link java.util.concurrent.CompletionStage} instances factory
|
||||||
|
*/
|
||||||
|
public ApiClient setCallAdapterFactory(Play26CallAdapterFactory callAdapterFactory) {
|
||||||
|
this.callAdapterFactory = callAdapterFactory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set Jackson's {@link ObjectMapper}
|
||||||
|
*/
|
||||||
|
public ApiClient setObjectMapper(ObjectMapper mapper) {
|
||||||
|
this.defaultMapper = mapper;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class FileConverter extends Converter.Factory {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Converter<ResponseBody, File> responseBodyConverter(Type type,
|
||||||
|
Annotation[] annotations, Retrofit retrofit) {
|
||||||
|
|
||||||
|
if (!File.class.getTypeName().equals(type.getTypeName())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Converter<ResponseBody, File>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File convert(ResponseBody value) throws IOException {
|
||||||
|
|
||||||
|
File file = File.createTempFile("retrofit-file", ".tmp");
|
||||||
|
Files.write(Paths.get(file.getPath()), value.bytes());
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,116 @@
|
|||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import retrofit2.*;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.lang.reflect.WildcardType;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
||||||
|
*/
|
||||||
|
public class Play26CallAdapterFactory extends CallAdapter.Factory {
|
||||||
|
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter = Function.identity();
|
||||||
|
|
||||||
|
public Play26CallAdapterFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallAdapterFactory(
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
||||||
|
if (!(returnType instanceof ParameterizedType)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
ParameterizedType type = (ParameterizedType) returnType;
|
||||||
|
if (type.getRawType() != CompletionStage.class) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return createAdapter((ParameterizedType) returnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CallAdapter<?, CompletionStage<?>> createAdapter(ParameterizedType returnType) {
|
||||||
|
// Get CompletionStage type argument
|
||||||
|
Type[] types = returnType.getActualTypeArguments();
|
||||||
|
if (types.length != 1) {
|
||||||
|
throw new IllegalStateException("Must be exactly one type parameter");
|
||||||
|
}
|
||||||
|
|
||||||
|
Type resultType = types[0];
|
||||||
|
Class<?> rawTypeParam = getRawType(resultType);
|
||||||
|
|
||||||
|
boolean includeResponse = false;
|
||||||
|
if (rawTypeParam == Response.class) {
|
||||||
|
if (!(resultType instanceof ParameterizedType)) {
|
||||||
|
throw new IllegalStateException("Response must be parameterized"
|
||||||
|
+ " as Response<T>");
|
||||||
|
}
|
||||||
|
resultType = ((ParameterizedType) resultType).getActualTypeArguments()[0];
|
||||||
|
includeResponse = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ValueAdapter(resultType, includeResponse, exceptionConverter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adpater that coverts values returned by API interface into CompletionStage
|
||||||
|
*/
|
||||||
|
private static final class ValueAdapter<R> implements CallAdapter<R, CompletionStage<R>> {
|
||||||
|
|
||||||
|
private final Type responseType;
|
||||||
|
private final boolean includeResponse;
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter;
|
||||||
|
|
||||||
|
ValueAdapter(Type responseType, boolean includeResponse,
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.responseType = responseType;
|
||||||
|
this.includeResponse = includeResponse;
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type responseType() {
|
||||||
|
return responseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletionStage<R> adapt(final Call<R> call) {
|
||||||
|
final CompletableFuture<R> promise = new CompletableFuture();
|
||||||
|
|
||||||
|
call.enqueue(new Callback<R>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<R> call, Response<R> response) {
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
if (includeResponse) {
|
||||||
|
promise.complete((R) response);
|
||||||
|
} else {
|
||||||
|
promise.complete(response.body());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
promise.completeExceptionally(exceptionConverter.apply(new HttpException(response)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<R> call, Throwable t) {
|
||||||
|
promise.completeExceptionally(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,245 @@
|
|||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import okhttp3.*;
|
||||||
|
import okio.Buffer;
|
||||||
|
import okio.BufferedSource;
|
||||||
|
import play.libs.ws.WSClient;
|
||||||
|
import play.libs.ws.WSRequest;
|
||||||
|
import play.libs.ws.WSResponse;
|
||||||
|
import play.libs.ws.WSRequestFilter;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@link Call} instances that invoke underlying {@link WSClient}
|
||||||
|
*/
|
||||||
|
public class Play26CallFactory implements okhttp3.Call.Factory {
|
||||||
|
|
||||||
|
/** PlayWS http client */
|
||||||
|
private final WSClient wsClient;
|
||||||
|
|
||||||
|
/** Extra headers to add to request */
|
||||||
|
private Map<String, String> extraHeaders = new HashMap<>();
|
||||||
|
|
||||||
|
/** Extra query parameters to add to request */
|
||||||
|
private List<Pair> extraQueryParams = new ArrayList<>();
|
||||||
|
|
||||||
|
/** Filters (interceptors) */
|
||||||
|
private List<WSRequestFilter> filters = new ArrayList<>();
|
||||||
|
|
||||||
|
/** Executor for WSClient */
|
||||||
|
private Executor executor;
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient, List<WSRequestFilter> filters) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
this.filters.addAll(filters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient, Map<String, String> extraHeaders,
|
||||||
|
List<Pair> extraQueryParams) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
|
||||||
|
this.extraHeaders.putAll(extraHeaders);
|
||||||
|
this.extraQueryParams.addAll(extraQueryParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory withExecutor(Executor executor) {
|
||||||
|
this.executor = executor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Call newCall(Request request) {
|
||||||
|
// add extra headers
|
||||||
|
Request.Builder rb = request.newBuilder();
|
||||||
|
for (Map.Entry<String, String> header : this.extraHeaders.entrySet()) {
|
||||||
|
rb.addHeader(header.getKey(), header.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
// add extra query params
|
||||||
|
if (!this.extraQueryParams.isEmpty()) {
|
||||||
|
String newQuery = request.url().uri().getQuery();
|
||||||
|
for (Pair queryParam : this.extraQueryParams) {
|
||||||
|
String param = String.format("%s=%s", queryParam.getName(), queryParam.getValue());
|
||||||
|
if (newQuery == null) {
|
||||||
|
newQuery = param;
|
||||||
|
} else {
|
||||||
|
newQuery += "&" + param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
URI newUri;
|
||||||
|
try {
|
||||||
|
newUri = new URI(request.url().uri().getScheme(), request.url().uri().getAuthority(),
|
||||||
|
request.url().uri().getPath(), newQuery, request.url().uri().getFragment());
|
||||||
|
rb.url(newUri.toURL());
|
||||||
|
} catch (MalformedURLException | URISyntaxException e) {
|
||||||
|
throw new RuntimeException("Error while updating an url", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PlayWSCall(wsClient, this.executor, this.filters, rb.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call implementation that delegates to Play WS Client
|
||||||
|
*/
|
||||||
|
static class PlayWSCall implements Call {
|
||||||
|
|
||||||
|
private final WSClient wsClient;
|
||||||
|
private WSRequest wsRequest;
|
||||||
|
private List<WSRequestFilter> filters;
|
||||||
|
private Executor executor = java.util.concurrent.ForkJoinPool.commonPool();
|
||||||
|
|
||||||
|
private final Request request;
|
||||||
|
|
||||||
|
public PlayWSCall(WSClient wsClient, Executor executor, List<WSRequestFilter> filters, Request request) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
this.request = request;
|
||||||
|
this.filters = filters;
|
||||||
|
|
||||||
|
if (executor != null) {
|
||||||
|
this.executor = executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Request request() {
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enqueue(final okhttp3.Callback responseCallback) {
|
||||||
|
final Call call = this;
|
||||||
|
final CompletionStage<WSResponse> promise = executeAsync();
|
||||||
|
|
||||||
|
promise.whenCompleteAsync((v, t) -> {
|
||||||
|
if (t != null) {
|
||||||
|
if (t instanceof IOException) {
|
||||||
|
responseCallback.onFailure(call, (IOException) t);
|
||||||
|
} else {
|
||||||
|
responseCallback.onFailure(call, new IOException(t));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
responseCallback.onResponse(call, PlayWSCall.this.toWSResponse(v));
|
||||||
|
} catch (Exception e) {
|
||||||
|
responseCallback.onFailure(call, new IOException(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, this.executor);
|
||||||
|
}
|
||||||
|
|
||||||
|
CompletionStage<WSResponse> executeAsync() {
|
||||||
|
try {
|
||||||
|
HttpUrl url = request.url();
|
||||||
|
wsRequest = wsClient.url(url.scheme()+ "://" + url.host() + ":" + url.port() + url.encodedPath());
|
||||||
|
url.queryParameterNames().forEach(queryParam -> {
|
||||||
|
wsRequest.addQueryParameter(queryParam, url.queryParameter(queryParam));
|
||||||
|
});
|
||||||
|
addHeaders(wsRequest);
|
||||||
|
if (request.body() != null) {
|
||||||
|
addBody(wsRequest);
|
||||||
|
}
|
||||||
|
filters.stream().forEach(f -> wsRequest.setRequestFilter(f));
|
||||||
|
|
||||||
|
return wsRequest.execute(request.method());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addHeaders(WSRequest wsRequest) {
|
||||||
|
for(Map.Entry<String, List<String>> entry : request.headers().toMultimap().entrySet()) {
|
||||||
|
List<String> values = entry.getValue();
|
||||||
|
for (String value : values) {
|
||||||
|
wsRequest.setHeader(entry.getKey(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addBody(WSRequest wsRequest) throws IOException {
|
||||||
|
MediaType mediaType = request.body().contentType();
|
||||||
|
if (mediaType != null) {
|
||||||
|
wsRequest.setContentType(mediaType.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
Buffer buffer = new Buffer();
|
||||||
|
request.body().writeTo(buffer);
|
||||||
|
wsRequest.setBody(buffer.inputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Response toWSResponse(final WSResponse r) {
|
||||||
|
final Response.Builder builder = new Response.Builder();
|
||||||
|
builder.request(request)
|
||||||
|
.code(r.getStatus())
|
||||||
|
.body(new ResponseBody() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MediaType contentType() {
|
||||||
|
return r.getSingleHeader("Content-Type")
|
||||||
|
.map(MediaType::parse)
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long contentLength() {
|
||||||
|
return r.asByteArray().length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BufferedSource source() {
|
||||||
|
return new Buffer().write(r.asByteArray());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (Map.Entry<String, List<String>> entry : r.getAllHeaders().entrySet()) {
|
||||||
|
for (String value : entry.getValue()) {
|
||||||
|
builder.addHeader(entry.getKey(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.message(r.getStatusText());
|
||||||
|
builder.protocol(Protocol.HTTP_1_1);
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response execute() throws IOException {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel() {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlayWSCall clone() {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isExecuted() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCanceled() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package {{package}};
|
||||||
|
|
||||||
|
import {{invokerPackage}}.CollectionFormats.*;
|
||||||
|
|
||||||
|
{{#useRxJava}}import rx.Observable;{{/useRxJava}}
|
||||||
|
{{#useRxJava2}}import io.reactivex.Observable;{{/useRxJava2}}
|
||||||
|
{{#doNotUseRx}}import retrofit2.Call;{{/doNotUseRx}}
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
{{#imports}}import {{import}};
|
||||||
|
{{/imports}}
|
||||||
|
|
||||||
|
{{^fullJavaUtil}}
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
{{/fullJavaUtil}}
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
public interface {{classname}} {
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}}
|
||||||
|
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
* @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
|
||||||
|
*/
|
||||||
|
{{#formParams}}
|
||||||
|
{{#-first}}
|
||||||
|
{{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}}
|
||||||
|
{{/-first}}
|
||||||
|
{{/formParams}}
|
||||||
|
{{^formParams}}
|
||||||
|
{{#prioritizedContentTypes}}
|
||||||
|
{{#-first}}
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:{{{mediaType}}}"
|
||||||
|
})
|
||||||
|
{{/-first}}
|
||||||
|
{{/prioritizedContentTypes}}
|
||||||
|
{{/formParams}}
|
||||||
|
@{{httpMethod}}("{{{path}}}")
|
||||||
|
CompletionStage<Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>> {{operationId}}({{^allParams}});{{/allParams}}
|
||||||
|
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||||
|
);{{/hasMore}}{{/allParams}}
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
}
|
||||||
|
{{/operations}}
|
@ -300,11 +300,34 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
{{/withXml}}
|
{{/withXml}}
|
||||||
|
|
||||||
|
{{#play24}}
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.typesafe.play</groupId>
|
<groupId>com.typesafe.play</groupId>
|
||||||
<artifactId>play-java-ws_2.11</artifactId>
|
<artifactId>play-java-ws_2.11</artifactId>
|
||||||
<version>${play-version}</version>
|
<version>${play-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
{{/play24}}
|
||||||
|
{{#play25}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.typesafe.play</groupId>
|
||||||
|
<artifactId>play-java-ws_2.11</artifactId>
|
||||||
|
<version>${play-version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{/play25}}
|
||||||
|
{{#play26}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.typesafe.play</groupId>
|
||||||
|
<artifactId>play-ahc-ws_2.12</artifactId>
|
||||||
|
<version>${play-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>1.1.0.Final</version>
|
||||||
|
</dependency>
|
||||||
|
{{/play26}}
|
||||||
|
|
||||||
{{/usePlayWS}}
|
{{/usePlayWS}}
|
||||||
|
|
||||||
{{#parcelableModel}}
|
{{#parcelableModel}}
|
||||||
@ -341,6 +364,10 @@
|
|||||||
<jackson-version>2.7.8</jackson-version>
|
<jackson-version>2.7.8</jackson-version>
|
||||||
<play-version>2.5.15</play-version>
|
<play-version>2.5.15</play-version>
|
||||||
{{/play25}}
|
{{/play25}}
|
||||||
|
{{#play26}}
|
||||||
|
<jackson-version>2.8.10</jackson-version>
|
||||||
|
<play-version>2.6.7</play-version>
|
||||||
|
{{/play26}}
|
||||||
{{/usePlayWS}}
|
{{/usePlayWS}}
|
||||||
<retrofit-version>2.3.0</retrofit-version>
|
<retrofit-version>2.3.0</retrofit-version>
|
||||||
{{#useRxJava}}
|
{{#useRxJava}}
|
||||||
|
@ -1 +1 @@
|
|||||||
3.0.0-SNAPSHOT
|
3.2.3-SNAPSHOT
|
@ -1,6 +1,6 @@
|
|||||||
# FakeApi
|
# FakeApi
|
||||||
|
|
||||||
All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
All URIs are relative to *http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
@ -13,6 +13,8 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
|
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```java
|
```java
|
||||||
// Import classes:
|
// Import classes:
|
||||||
@ -21,7 +23,7 @@ To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
|||||||
|
|
||||||
|
|
||||||
FakeApi apiInstance = new FakeApi();
|
FakeApi apiInstance = new FakeApi();
|
||||||
Object UNKNOWN_BASE_TYPE = new UNKNOWN_BASE_TYPE(); // Object |
|
UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE = new UNKNOWN_BASE_TYPE(); // UNKNOWN_BASE_TYPE |
|
||||||
try {
|
try {
|
||||||
apiInstance.testCodeInjectEndRnNR(UNKNOWN_BASE_TYPE);
|
apiInstance.testCodeInjectEndRnNR(UNKNOWN_BASE_TYPE);
|
||||||
} catch (ApiException e) {
|
} catch (ApiException e) {
|
||||||
@ -34,7 +36,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**UNKNOWN_BASE_TYPE** | [**Object**](UNKNOWN_BASE_TYPE.md)| | [optional]
|
**UNKNOWN_BASE_TYPE** | [**UNKNOWN_BASE_TYPE**](UNKNOWN_BASE_TYPE.md)| | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ import org.openapitools.client.auth.OAuth;
|
|||||||
|
|
||||||
public class ApiClient {
|
public class ApiClient {
|
||||||
|
|
||||||
private String basePath = "petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r";
|
private String basePath = "http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r";
|
||||||
private boolean debugging = false;
|
private boolean debugging = false;
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
private String tempFolderPath = null;
|
private String tempFolderPath = null;
|
||||||
@ -107,7 +107,7 @@ public class ApiClient {
|
|||||||
/**
|
/**
|
||||||
* Set base path
|
* Set base path
|
||||||
*
|
*
|
||||||
* @param basePath Base path of the URL (e.g petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r
|
* @param basePath Base path of the URL (e.g http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @return An instance of OkHttpClient
|
* @return An instance of OkHttpClient
|
||||||
*/
|
*/
|
||||||
public ApiClient setBasePath(String basePath) {
|
public ApiClient setBasePath(String basePath) {
|
||||||
@ -895,7 +895,7 @@ public class ApiClient {
|
|||||||
* @param <T> Type
|
* @param <T> Type
|
||||||
* @param response Response
|
* @param response Response
|
||||||
* @param returnType Return type
|
* @param returnType Return type
|
||||||
* @throws ApiException If the response has a unsuccessful status code or
|
* @throws ApiException If the response has an unsuccessful status code or
|
||||||
* fail to deserialize the response body
|
* fail to deserialize the response body
|
||||||
* @return Type
|
* @return Type
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
@ -15,21 +15,19 @@ package org.openapitools.client;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.TypeAdapter;
|
import com.google.gson.TypeAdapter;
|
||||||
import com.google.gson.internal.bind.util.ISO8601Utils;
|
import com.google.gson.internal.bind.util.ISO8601Utils;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import io.gsonfire.GsonFireBuilder;
|
import io.gsonfire.GsonFireBuilder;
|
||||||
import io.gsonfire.TypeSelector;
|
import okio.ByteString;
|
||||||
|
import org.openapitools.client.model.*;
|
||||||
import org.threeten.bp.LocalDate;
|
import org.threeten.bp.LocalDate;
|
||||||
import org.threeten.bp.OffsetDateTime;
|
import org.threeten.bp.OffsetDateTime;
|
||||||
import org.threeten.bp.format.DateTimeFormatter;
|
import org.threeten.bp.format.DateTimeFormatter;
|
||||||
|
|
||||||
import org.openapitools.client.model.*;
|
|
||||||
import okio.ByteString;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
@ -37,8 +35,8 @@ import java.text.DateFormat;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.ParsePosition;
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class JSON {
|
public class JSON {
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
@ -51,8 +49,10 @@ public class JSON {
|
|||||||
|
|
||||||
public static GsonBuilder createGson() {
|
public static GsonBuilder createGson() {
|
||||||
GsonFireBuilder fireBuilder = new GsonFireBuilder()
|
GsonFireBuilder fireBuilder = new GsonFireBuilder()
|
||||||
|
|
||||||
;
|
;
|
||||||
return fireBuilder.createGsonBuilder();
|
GsonBuilder builder = fireBuilder.createGsonBuilder();
|
||||||
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
|
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
|
||||||
@ -64,7 +64,7 @@ public class JSON {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
|
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
|
||||||
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase());
|
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase(Locale.ROOT));
|
||||||
if(null == clazz) {
|
if(null == clazz) {
|
||||||
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
|
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
|
import org.openapitools.client.model.UNKNOWN_BASE_TYPE;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -61,7 +62,7 @@ public class FakeApi {
|
|||||||
* @return Call to execute
|
* @return Call to execute
|
||||||
* @throws ApiException If fail to serialize the request body object
|
* @throws ApiException If fail to serialize the request body object
|
||||||
*/
|
*/
|
||||||
public com.squareup.okhttp.Call testCodeInjectEndRnNRCall(Object UNKNOWN_BASE_TYPE, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
public com.squareup.okhttp.Call testCodeInjectEndRnNRCall(UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
Object localVarPostBody = UNKNOWN_BASE_TYPE;
|
Object localVarPostBody = UNKNOWN_BASE_TYPE;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
@ -103,7 +104,7 @@ public class FakeApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
private com.squareup.okhttp.Call testCodeInjectEndRnNRValidateBeforeCall(Object UNKNOWN_BASE_TYPE, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
private com.squareup.okhttp.Call testCodeInjectEndRnNRValidateBeforeCall(UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
|
|
||||||
|
|
||||||
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(UNKNOWN_BASE_TYPE, progressListener, progressRequestListener);
|
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(UNKNOWN_BASE_TYPE, progressListener, progressRequestListener);
|
||||||
@ -113,35 +114,35 @@ public class FakeApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
*
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @param UNKNOWN_BASE_TYPE (optional)
|
* @param UNKNOWN_BASE_TYPE (optional)
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
*/
|
*/
|
||||||
public void testCodeInjectEndRnNR(Object UNKNOWN_BASE_TYPE) throws ApiException {
|
public void testCodeInjectEndRnNR(UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE) throws ApiException {
|
||||||
testCodeInjectEndRnNRWithHttpInfo(UNKNOWN_BASE_TYPE);
|
testCodeInjectEndRnNRWithHttpInfo(UNKNOWN_BASE_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
*
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @param UNKNOWN_BASE_TYPE (optional)
|
* @param UNKNOWN_BASE_TYPE (optional)
|
||||||
* @return ApiResponse<Void>
|
* @return ApiResponse<Void>
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
*/
|
*/
|
||||||
public ApiResponse<Void> testCodeInjectEndRnNRWithHttpInfo(Object UNKNOWN_BASE_TYPE) throws ApiException {
|
public ApiResponse<Void> testCodeInjectEndRnNRWithHttpInfo(UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE) throws ApiException {
|
||||||
com.squareup.okhttp.Call call = testCodeInjectEndRnNRValidateBeforeCall(UNKNOWN_BASE_TYPE, null, null);
|
com.squareup.okhttp.Call call = testCodeInjectEndRnNRValidateBeforeCall(UNKNOWN_BASE_TYPE, null, null);
|
||||||
return apiClient.execute(call);
|
return apiClient.execute(call);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (asynchronously)
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (asynchronously)
|
||||||
*
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @param UNKNOWN_BASE_TYPE (optional)
|
* @param UNKNOWN_BASE_TYPE (optional)
|
||||||
* @param callback The callback to be executed when the API call finishes
|
* @param callback The callback to be executed when the API call finishes
|
||||||
* @return The request call
|
* @return The request call
|
||||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||||
*/
|
*/
|
||||||
public com.squareup.okhttp.Call testCodeInjectEndRnNRAsync(Object UNKNOWN_BASE_TYPE, final ApiCallback<Void> callback) throws ApiException {
|
public com.squareup.okhttp.Call testCodeInjectEndRnNRAsync(UNKNOWN_BASE_TYPE UNKNOWN_BASE_TYPE, final ApiCallback<Void> callback) throws ApiException {
|
||||||
|
|
||||||
ProgressResponseBody.ProgressListener progressListener = null;
|
ProgressResponseBody.ProgressListener progressListener = null;
|
||||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
|
||||||
*
|
*
|
||||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
@ -13,16 +13,11 @@
|
|||||||
|
|
||||||
package org.openapitools.client.model;
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import com.google.gson.TypeAdapter;
|
|
||||||
import com.google.gson.annotations.JsonAdapter;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.google.gson.stream.JsonReader;
|
|
||||||
import com.google.gson.stream.JsonWriter;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.io.IOException;
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
@ -30,7 +25,8 @@ import java.io.IOException;
|
|||||||
@ApiModel(description = "Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r")
|
@ApiModel(description = "Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r")
|
||||||
|
|
||||||
public class ModelReturn {
|
public class ModelReturn {
|
||||||
@SerializedName("return")
|
public static final String SERIALIZED_NAME_RETURN = "return";
|
||||||
|
@SerializedName(SERIALIZED_NAME_RETURN)
|
||||||
private Integer _return = null;
|
private Integer _return = null;
|
||||||
|
|
||||||
public ModelReturn _return(Integer _return) {
|
public ModelReturn _return(Integer _return) {
|
||||||
@ -74,7 +70,7 @@ public class ModelReturn {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class ModelReturn {\n");
|
sb.append("class ModelReturn {\n");
|
||||||
|
|
||||||
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
@ -251,6 +251,7 @@
|
|||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>${jackson-version}</version>
|
<version>${jackson-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.typesafe.play</groupId>
|
<groupId>com.typesafe.play</groupId>
|
||||||
<artifactId>play-java-ws_2.11</artifactId>
|
<artifactId>play-java-ws_2.11</artifactId>
|
||||||
@ -258,6 +259,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
@ -256,6 +256,7 @@
|
|||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>${jackson-version}</version>
|
<version>${jackson-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.typesafe.play</groupId>
|
<groupId>com.typesafe.play</groupId>
|
||||||
<artifactId>play-java-ws_2.11</artifactId>
|
<artifactId>play-java-ws_2.11</artifactId>
|
||||||
@ -263,6 +264,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
21
samples/client/petstore/java/retrofit2-play26/.gitignore
vendored
Normal file
21
samples/client/petstore/java/retrofit2-play26/.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
*.class
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# exclude jar for gradle wrapper
|
||||||
|
!gradle/wrapper/*.jar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
# build files
|
||||||
|
**/target
|
||||||
|
target
|
||||||
|
.gradle
|
||||||
|
build
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -0,0 +1 @@
|
|||||||
|
3.2.3-SNAPSHOT
|
17
samples/client/petstore/java/retrofit2-play26/.travis.yml
Normal file
17
samples/client/petstore/java/retrofit2-play26/.travis.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# Generated by: https://openapi-generator.tech
|
||||||
|
#
|
||||||
|
language: java
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
- oraclejdk7
|
||||||
|
before_install:
|
||||||
|
# ensure gradlew has proper permission
|
||||||
|
- chmod a+x ./gradlew
|
||||||
|
script:
|
||||||
|
# test using maven
|
||||||
|
- mvn test
|
||||||
|
# uncomment below to test using gradle
|
||||||
|
# - gradle test
|
||||||
|
# uncomment below to test using sbt
|
||||||
|
# - sbt test
|
39
samples/client/petstore/java/retrofit2-play26/README.md
Normal file
39
samples/client/petstore/java/retrofit2-play26/README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# petstore-java-client-retrofit2-play26
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
|
||||||
|
|
||||||
|
## Installation & Usage
|
||||||
|
|
||||||
|
To install the API client library to your local Maven repository, simply execute:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn install
|
||||||
|
```
|
||||||
|
|
||||||
|
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
|
||||||
|
|
||||||
|
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>petstore-java-client-retrofit2-play26</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
125
samples/client/petstore/java/retrofit2-play26/build.gradle
Normal file
125
samples/client/petstore/java/retrofit2-play26/build.gradle
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
apply plugin: 'idea'
|
||||||
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
|
group = 'org.openapitools'
|
||||||
|
version = '1.0.0'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.+'
|
||||||
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 25
|
||||||
|
buildToolsVersion '25.0.2'
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 25
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rename the aar correctly
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def outputFile = output.outputFile
|
||||||
|
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||||
|
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||||
|
output.outputFile = new File(outputFile.parent, fileName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
provided 'javax.annotation:jsr250-api:1.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
android.libraryVariants.all { variant ->
|
||||||
|
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||||
|
task.description = "Create jar artifact for ${variant.name}"
|
||||||
|
task.dependsOn variant.javaCompile
|
||||||
|
task.from variant.javaCompile.destinationDir
|
||||||
|
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||||
|
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||||
|
artifacts.add('archives', task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task sourcesJar(type: Jar) {
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
classifier = 'sources'
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
archives sourcesJar
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'maven'
|
||||||
|
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
install {
|
||||||
|
repositories.mavenInstaller {
|
||||||
|
pom.artifactId = 'petstore-java-client-retrofit2-play26'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execute(type:JavaExec) {
|
||||||
|
main = System.getProperty('mainClass')
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
oltu_version = "1.0.1"
|
||||||
|
retrofit_version = "2.3.0"
|
||||||
|
jackson_version = "2.8.10"
|
||||||
|
play_version = "2.6.7"
|
||||||
|
swagger_annotations_version = "1.5.17"
|
||||||
|
junit_version = "4.12"
|
||||||
|
threetenbp_version = "1.3.5"
|
||||||
|
json_fire_version = "1.8.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||||
|
compile "com.squareup.retrofit2:converter-scalars:$retrofit_version"
|
||||||
|
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
||||||
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
|
compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){
|
||||||
|
exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common'
|
||||||
|
}
|
||||||
|
compile "io.gsonfire:gson-fire:$json_fire_version"
|
||||||
|
compile "org.threeten:threetenbp:$threetenbp_version"
|
||||||
|
compile "com.typesafe.play:play-ahc-ws_2.12:$play_version"
|
||||||
|
compile "javax.validation:validation-api:1.1.0.Final"
|
||||||
|
compile "com.squareup.retrofit2:converter-jackson:$retrofit_version"
|
||||||
|
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||||
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||||
|
|
||||||
|
testCompile "junit:junit:$junit_version"
|
||||||
|
}
|
27
samples/client/petstore/java/retrofit2-play26/build.sbt
Normal file
27
samples/client/petstore/java/retrofit2-play26/build.sbt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization := "org.openapitools",
|
||||||
|
name := "petstore-java-client-retrofit2-play26",
|
||||||
|
version := "1.0.0",
|
||||||
|
scalaVersion := "2.11.4",
|
||||||
|
scalacOptions ++= Seq("-feature"),
|
||||||
|
javacOptions in compile ++= Seq("-Xlint:deprecation"),
|
||||||
|
publishArtifact in (Compile, packageDoc) := false,
|
||||||
|
resolvers += Resolver.mavenLocal,
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
"com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile",
|
||||||
|
"com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile",
|
||||||
|
"com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile",
|
||||||
|
"javax.validation" % "validation-api" % "1.1.0.Final" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.10" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.10" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.10" % "compile",
|
||||||
|
"com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile",
|
||||||
|
"io.swagger" % "swagger-annotations" % "1.5.17" % "compile",
|
||||||
|
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile",
|
||||||
|
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
|
||||||
|
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
|
||||||
|
"junit" % "junit" % "4.12" % "test",
|
||||||
|
"com.novocode" % "junit-interface" % "0.11" % "test"
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# AdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapProperty** | **Map<String, String>** | | [optional]
|
||||||
|
**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/java/retrofit2-play26/docs/Animal.md
Normal file
11
samples/client/petstore/java/retrofit2-play26/docs/Animal.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **String** | |
|
||||||
|
**color** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# AnimalFarm
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
# AnotherFakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** another-fake/dummy | To test special tags
|
||||||
|
|
||||||
|
|
||||||
|
<a name="call123testSpecialTags"></a>
|
||||||
|
# **call123testSpecialTags**
|
||||||
|
> Client call123testSpecialTags(client)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.AnotherFakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
AnotherFakeApi apiInstance = new AnotherFakeApi();
|
||||||
|
Client client = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.call123testSpecialTags(client);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ArrayOfArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# ArrayTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayOfString** | **List<String>** | | [optional]
|
||||||
|
**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
|
||||||
|
**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
# Capitalization
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**smallCamel** | **String** | | [optional]
|
||||||
|
**capitalCamel** | **String** | | [optional]
|
||||||
|
**smallSnake** | **String** | | [optional]
|
||||||
|
**capitalSnake** | **String** | | [optional]
|
||||||
|
**scAETHFlowPoints** | **String** | | [optional]
|
||||||
|
**ATT_NAME** | **String** | Name of the pet | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/retrofit2-play26/docs/Cat.md
Normal file
10
samples/client/petstore/java/retrofit2-play26/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ClassModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/retrofit2-play26/docs/Client.md
Normal file
10
samples/client/petstore/java/retrofit2-play26/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Client
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/retrofit2-play26/docs/Dog.md
Normal file
10
samples/client/petstore/java/retrofit2-play26/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
# EnumArrays
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
|
||||||
|
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="JustSymbolEnum"></a>
|
||||||
|
## Enum: JustSymbolEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
GREATER_THAN_OR_EQUAL_TO | ">="
|
||||||
|
DOLLAR | "$"
|
||||||
|
|
||||||
|
|
||||||
|
<a name="List<ArrayEnumEnum>"></a>
|
||||||
|
## Enum: List<ArrayEnumEnum>
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
FISH | "fish"
|
||||||
|
CRAB | "crab"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# EnumClass
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `_ABC` (value: `"_abc"`)
|
||||||
|
|
||||||
|
* `_EFG` (value: `"-efg"`)
|
||||||
|
|
||||||
|
* `_XYZ_` (value: `"(xyz)"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
# EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
|
||||||
|
**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
|
||||||
|
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
|
||||||
|
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
|
||||||
|
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="EnumStringEnum"></a>
|
||||||
|
## Enum: EnumStringEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
EMPTY | ""
|
||||||
|
|
||||||
|
|
||||||
|
<a name="EnumStringRequiredEnum"></a>
|
||||||
|
## Enum: EnumStringRequiredEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
EMPTY | ""
|
||||||
|
|
||||||
|
|
||||||
|
<a name="EnumIntegerEnum"></a>
|
||||||
|
## Enum: EnumIntegerEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
NUMBER_1 | 1
|
||||||
|
NUMBER_MINUS_1 | -1
|
||||||
|
|
||||||
|
|
||||||
|
<a name="EnumNumberEnum"></a>
|
||||||
|
## Enum: EnumNumberEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
NUMBER_1_DOT_1 | 1.1
|
||||||
|
NUMBER_MINUS_1_DOT_2 | -1.2
|
||||||
|
|
||||||
|
|
||||||
|
|
555
samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md
Normal file
555
samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md
Normal file
@ -0,0 +1,555 @@
|
|||||||
|
# FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** fake/outer/boolean |
|
||||||
|
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite |
|
||||||
|
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number |
|
||||||
|
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string |
|
||||||
|
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** fake/body-with-file-schema |
|
||||||
|
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** fake/body-with-query-params |
|
||||||
|
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model
|
||||||
|
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters
|
||||||
|
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties
|
||||||
|
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data
|
||||||
|
|
||||||
|
|
||||||
|
<a name="fakeOuterBooleanSerialize"></a>
|
||||||
|
# **fakeOuterBooleanSerialize**
|
||||||
|
> Boolean fakeOuterBooleanSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer boolean types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
Boolean body = true; // Boolean | Input boolean as post body
|
||||||
|
try {
|
||||||
|
Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **Boolean**| Input boolean as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Boolean**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
<a name="fakeOuterCompositeSerialize"></a>
|
||||||
|
# **fakeOuterCompositeSerialize**
|
||||||
|
> OuterComposite fakeOuterCompositeSerialize(outerComposite)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of object with outer number type
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body
|
||||||
|
try {
|
||||||
|
OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**OuterComposite**](OuterComposite.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
<a name="fakeOuterNumberSerialize"></a>
|
||||||
|
# **fakeOuterNumberSerialize**
|
||||||
|
> BigDecimal fakeOuterNumberSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer number types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body
|
||||||
|
try {
|
||||||
|
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **BigDecimal**| Input number as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**BigDecimal**](BigDecimal.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
<a name="fakeOuterStringSerialize"></a>
|
||||||
|
# **fakeOuterStringSerialize**
|
||||||
|
> String fakeOuterStringSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer string types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
String body = "body_example"; // String | Input string as post body
|
||||||
|
try {
|
||||||
|
String result = apiInstance.fakeOuterStringSerialize(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **String**| Input string as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
<a name="testBodyWithFileSchema"></a>
|
||||||
|
# **testBodyWithFileSchema**
|
||||||
|
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
For this test, the body for this request much reference a schema named `File`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||||
|
try {
|
||||||
|
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testBodyWithQueryParams"></a>
|
||||||
|
# **testBodyWithQueryParams**
|
||||||
|
> testBodyWithQueryParams(query, user)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
String query = "query_example"; // String |
|
||||||
|
User user = new User(); // User |
|
||||||
|
try {
|
||||||
|
apiInstance.testBodyWithQueryParams(query, user);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**query** | **String**| |
|
||||||
|
**user** | [**User**](User.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testClientModel"></a>
|
||||||
|
# **testClientModel**
|
||||||
|
> Client testClientModel(client)
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
Client client = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.testClientModel(client);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
<a name="testEndpointParameters"></a>
|
||||||
|
# **testEndpointParameters**
|
||||||
|
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure HTTP basic authorization: http_basic_test
|
||||||
|
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
|
||||||
|
http_basic_test.setUsername("YOUR USERNAME");
|
||||||
|
http_basic_test.setPassword("YOUR PASSWORD");
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
BigDecimal number = new BigDecimal(); // BigDecimal | None
|
||||||
|
Double _double = 3.4D; // Double | None
|
||||||
|
String patternWithoutDelimiter = "null"; // String | None
|
||||||
|
byte[] _byte = null; // byte[] | None
|
||||||
|
Integer integer = null; // Integer | None
|
||||||
|
Integer int32 = null; // Integer | None
|
||||||
|
Long int64 = nullL; // Long | None
|
||||||
|
Float _float = nullF; // Float | None
|
||||||
|
String string = "null"; // String | None
|
||||||
|
File binary = new File("null"); // File | None
|
||||||
|
LocalDate date = new LocalDate(); // LocalDate | None
|
||||||
|
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
|
||||||
|
String password = "null"; // String | None
|
||||||
|
String paramCallback = "null"; // String | None
|
||||||
|
try {
|
||||||
|
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testEndpointParameters");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**number** | **BigDecimal**| None | [default to null]
|
||||||
|
**_double** | **Double**| None | [default to null]
|
||||||
|
**patternWithoutDelimiter** | **String**| None | [default to null]
|
||||||
|
**_byte** | **byte[]**| None | [default to null]
|
||||||
|
**integer** | **Integer**| None | [optional] [default to null]
|
||||||
|
**int32** | **Integer**| None | [optional] [default to null]
|
||||||
|
**int64** | **Long**| None | [optional] [default to null]
|
||||||
|
**_float** | **Float**| None | [optional] [default to null]
|
||||||
|
**string** | **String**| None | [optional] [default to null]
|
||||||
|
**binary** | **File**| None | [optional] [default to null]
|
||||||
|
**date** | **LocalDate**| None | [optional] [default to null]
|
||||||
|
**dateTime** | **OffsetDateTime**| None | [optional] [default to null]
|
||||||
|
**password** | **String**| None | [optional] [default to null]
|
||||||
|
**paramCallback** | **String**| None | [optional] [default to null]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_basic_test](../README.md#http_basic_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testEnumParameters"></a>
|
||||||
|
# **testEnumParameters**
|
||||||
|
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
List<String> enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List<String> | Header parameter enum test (string array)
|
||||||
|
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
|
||||||
|
List<String> enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List<String> | Query parameter enum test (string array)
|
||||||
|
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
|
||||||
|
Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
|
||||||
|
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
|
||||||
|
List<String> enumFormStringArray = "$"; // List<String> | Form parameter enum test (string array)
|
||||||
|
String enumFormString = "-efg"; // String | Form parameter enum test (string)
|
||||||
|
try {
|
||||||
|
apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testEnumParameters");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
|
||||||
|
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||||
|
**enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
|
||||||
|
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||||
|
**enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
|
||||||
|
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
|
||||||
|
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
|
||||||
|
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testInlineAdditionalProperties"></a>
|
||||||
|
# **testInlineAdditionalProperties**
|
||||||
|
> testInlineAdditionalProperties(requestBody)
|
||||||
|
|
||||||
|
test inline additionalProperties
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
Map<String, String> requestBody = new HashMap(); // Map<String, String> | request body
|
||||||
|
try {
|
||||||
|
apiInstance.testInlineAdditionalProperties(requestBody);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**requestBody** | [**Map<String, String>**](String.md)| request body |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testJsonFormData"></a>
|
||||||
|
# **testJsonFormData**
|
||||||
|
> testJsonFormData(param, param2)
|
||||||
|
|
||||||
|
test json serialization of form data
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.FakeApi;
|
||||||
|
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi();
|
||||||
|
String param = "null"; // String | field1
|
||||||
|
String param2 = "null"; // String | field2
|
||||||
|
try {
|
||||||
|
apiInstance.testJsonFormData(param, param2);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#testJsonFormData");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | **String**| field1 | [default to null]
|
||||||
|
**param2** | **String**| field2 | [default to null]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
@ -0,0 +1,64 @@
|
|||||||
|
# FakeClassnameTags123Api
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case
|
||||||
|
|
||||||
|
|
||||||
|
<a name="testClassname"></a>
|
||||||
|
# **testClassname**
|
||||||
|
> Client testClassname(client)
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.FakeClassnameTags123Api;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key_query
|
||||||
|
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
|
||||||
|
api_key_query.setApiKey("YOUR API KEY");
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//api_key_query.setApiKeyPrefix("Token");
|
||||||
|
|
||||||
|
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
|
||||||
|
Client client = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.testClassname(client);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key_query](../README.md#api_key_query)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# FileSchemaTestClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||||
|
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
# FormatTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**integer** | **Integer** | | [optional]
|
||||||
|
**int32** | **Integer** | | [optional]
|
||||||
|
**int64** | **Long** | | [optional]
|
||||||
|
**number** | [**BigDecimal**](BigDecimal.md) | |
|
||||||
|
**_float** | **Float** | | [optional]
|
||||||
|
**_double** | **Double** | | [optional]
|
||||||
|
**string** | **String** | | [optional]
|
||||||
|
**_byte** | **byte[]** | |
|
||||||
|
**binary** | [**File**](File.md) | | [optional]
|
||||||
|
**date** | [**LocalDate**](LocalDate.md) | |
|
||||||
|
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||||
|
**uuid** | [**UUID**](UUID.md) | | [optional]
|
||||||
|
**password** | **String** | |
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# HasOnlyReadOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional]
|
||||||
|
**foo** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
# MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||||
|
**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
|
||||||
|
**directMap** | **Map<String, Boolean>** | | [optional]
|
||||||
|
**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Map<String, InnerEnum>"></a>
|
||||||
|
## Enum: Map<String, InnerEnum>
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**uuid** | [**UUID**](UUID.md) | | [optional]
|
||||||
|
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||||
|
**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Model200Response
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Integer** | | [optional]
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# ModelApiResponse
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**code** | **Integer** | | [optional]
|
||||||
|
**type** | **String** | | [optional]
|
||||||
|
**message** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ModelReturn
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_return** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
13
samples/client/petstore/java/retrofit2-play26/docs/Name.md
Normal file
13
samples/client/petstore/java/retrofit2-play26/docs/Name.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
# Name
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Integer** | |
|
||||||
|
**snakeCase** | **Integer** | | [optional]
|
||||||
|
**property** | **String** | | [optional]
|
||||||
|
**_123number** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# NumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/retrofit2-play26/docs/Order.md
Normal file
24
samples/client/petstore/java/retrofit2-play26/docs/Order.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
# Order
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**petId** | **Long** | | [optional]
|
||||||
|
**quantity** | **Integer** | | [optional]
|
||||||
|
**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||||
|
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
|
||||||
|
**complete** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="StatusEnum"></a>
|
||||||
|
## Enum: StatusEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
PLACED | "placed"
|
||||||
|
APPROVED | "approved"
|
||||||
|
DELIVERED | "delivered"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# OuterComposite
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||||
|
**myString** | **String** | | [optional]
|
||||||
|
**myBoolean** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# OuterEnum
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `PLACED` (value: `"placed"`)
|
||||||
|
|
||||||
|
* `APPROVED` (value: `"approved"`)
|
||||||
|
|
||||||
|
* `DELIVERED` (value: `"delivered"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/retrofit2-play26/docs/Pet.md
Normal file
24
samples/client/petstore/java/retrofit2-play26/docs/Pet.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
# Pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**category** | [**Category**](Category.md) | | [optional]
|
||||||
|
**name** | **String** | |
|
||||||
|
**photoUrls** | **List<String>** | |
|
||||||
|
**tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||||
|
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
<a name="StatusEnum"></a>
|
||||||
|
## Enum: StatusEnum
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
AVAILABLE | "available"
|
||||||
|
PENDING | "pending"
|
||||||
|
SOLD | "sold"
|
||||||
|
|
||||||
|
|
||||||
|
|
494
samples/client/petstore/java/retrofit2-play26/docs/PetApi.md
Normal file
494
samples/client/petstore/java/retrofit2-play26/docs/PetApi.md
Normal file
@ -0,0 +1,494 @@
|
|||||||
|
# PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store
|
||||||
|
[**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet
|
||||||
|
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status
|
||||||
|
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags
|
||||||
|
[**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID
|
||||||
|
[**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet
|
||||||
|
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data
|
||||||
|
[**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image
|
||||||
|
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="addPet"></a>
|
||||||
|
# **addPet**
|
||||||
|
> addPet(pet)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
try {
|
||||||
|
apiInstance.addPet(pet);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#addPet");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="deletePet"></a>
|
||||||
|
# **deletePet**
|
||||||
|
> deletePet(petId, apiKey)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Long petId = 56L; // Long | Pet id to delete
|
||||||
|
String apiKey = "apiKey_example"; // String |
|
||||||
|
try {
|
||||||
|
apiInstance.deletePet(petId, apiKey);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#deletePet");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| Pet id to delete |
|
||||||
|
**apiKey** | **String**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="findPetsByStatus"></a>
|
||||||
|
# **findPetsByStatus**
|
||||||
|
> List<Pet> findPetsByStatus(status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
List<String> status = Arrays.asList("status_example"); // List<String> | Status values that need to be considered for filter
|
||||||
|
try {
|
||||||
|
List<Pet> result = apiInstance.findPetsByStatus(status);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#findPetsByStatus");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="findPetsByTags"></a>
|
||||||
|
# **findPetsByTags**
|
||||||
|
> List<Pet> findPetsByTags(tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
List<String> tags = Arrays.asList("tags_example"); // List<String> | Tags to filter by
|
||||||
|
try {
|
||||||
|
List<Pet> result = apiInstance.findPetsByTags(tags);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#findPetsByTags");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**List<String>**](String.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="getPetById"></a>
|
||||||
|
# **getPetById**
|
||||||
|
> Pet getPetById(petId)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||||
|
api_key.setApiKey("YOUR API KEY");
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//api_key.setApiKeyPrefix("Token");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Long petId = 56L; // Long | ID of pet to return
|
||||||
|
try {
|
||||||
|
Pet result = apiInstance.getPetById(petId);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#getPetById");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="updatePet"></a>
|
||||||
|
# **updatePet**
|
||||||
|
> updatePet(pet)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
try {
|
||||||
|
apiInstance.updatePet(pet);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#updatePet");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="updatePetWithForm"></a>
|
||||||
|
# **updatePetWithForm**
|
||||||
|
> updatePetWithForm(petId, name, status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Long petId = 56L; // Long | ID of pet that needs to be updated
|
||||||
|
String name = "null"; // String | Updated name of the pet
|
||||||
|
String status = "null"; // String | Updated status of the pet
|
||||||
|
try {
|
||||||
|
apiInstance.updatePetWithForm(petId, name, status);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#updatePetWithForm");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet that needs to be updated |
|
||||||
|
**name** | **String**| Updated name of the pet | [optional] [default to null]
|
||||||
|
**status** | **String**| Updated status of the pet | [optional] [default to null]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="uploadFile"></a>
|
||||||
|
# **uploadFile**
|
||||||
|
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Long petId = 56L; // Long | ID of pet to update
|
||||||
|
String additionalMetadata = "null"; // String | Additional data to pass to server
|
||||||
|
File file = new File("null"); // File | file to upload
|
||||||
|
try {
|
||||||
|
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#uploadFile");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet to update |
|
||||||
|
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||||
|
**file** | **File**| file to upload | [optional] [default to null]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelApiResponse**](ModelApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
<a name="uploadFileWithRequiredFile"></a>
|
||||||
|
# **uploadFileWithRequiredFile**
|
||||||
|
> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
|
||||||
|
|
||||||
|
uploads an image (required)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.PetApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||||
|
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||||
|
|
||||||
|
PetApi apiInstance = new PetApi();
|
||||||
|
Long petId = 56L; // Long | ID of pet to update
|
||||||
|
File requiredFile = new File("null"); // File | file to upload
|
||||||
|
String additionalMetadata = "null"; // String | Additional data to pass to server
|
||||||
|
try {
|
||||||
|
ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet to update |
|
||||||
|
**requiredFile** | **File**| file to upload | [default to null]
|
||||||
|
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelApiResponse**](ModelApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# ReadOnlyFirst
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional]
|
||||||
|
**baz** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# SpecialModelName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**$specialPropertyName** | **Long** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
195
samples/client/petstore/java/retrofit2-play26/docs/StoreApi.md
Normal file
195
samples/client/petstore/java/retrofit2-play26/docs/StoreApi.md
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
# StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID
|
||||||
|
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
|
||||||
|
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID
|
||||||
|
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
<a name="deleteOrder"></a>
|
||||||
|
# **deleteOrder**
|
||||||
|
> deleteOrder(orderId)
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.StoreApi;
|
||||||
|
|
||||||
|
|
||||||
|
StoreApi apiInstance = new StoreApi();
|
||||||
|
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||||
|
try {
|
||||||
|
apiInstance.deleteOrder(orderId);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling StoreApi#deleteOrder");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **String**| ID of the order that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="getInventory"></a>
|
||||||
|
# **getInventory**
|
||||||
|
> Map<String, Integer> getInventory()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiClient;
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.Configuration;
|
||||||
|
//import org.openapitools.client.auth.*;
|
||||||
|
//import org.openapitools.client.api.StoreApi;
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||||
|
api_key.setApiKey("YOUR API KEY");
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//api_key.setApiKeyPrefix("Token");
|
||||||
|
|
||||||
|
StoreApi apiInstance = new StoreApi();
|
||||||
|
try {
|
||||||
|
Map<String, Integer> result = apiInstance.getInventory();
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling StoreApi#getInventory");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Map<String, Integer>**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
<a name="getOrderById"></a>
|
||||||
|
# **getOrderById**
|
||||||
|
> Order getOrderById(orderId)
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.StoreApi;
|
||||||
|
|
||||||
|
|
||||||
|
StoreApi apiInstance = new StoreApi();
|
||||||
|
Long orderId = 56L; // Long | ID of pet that needs to be fetched
|
||||||
|
try {
|
||||||
|
Order result = apiInstance.getOrderById(orderId);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling StoreApi#getOrderById");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **Long**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="placeOrder"></a>
|
||||||
|
# **placeOrder**
|
||||||
|
> Order placeOrder(order)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.StoreApi;
|
||||||
|
|
||||||
|
|
||||||
|
StoreApi apiInstance = new StoreApi();
|
||||||
|
Order order = new Order(); // Order | order placed for purchasing the pet
|
||||||
|
try {
|
||||||
|
Order result = apiInstance.placeOrder(order);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling StoreApi#placeOrder");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# StringBooleanMap
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/java/retrofit2-play26/docs/Tag.md
Normal file
11
samples/client/petstore/java/retrofit2-play26/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Tag
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
17
samples/client/petstore/java/retrofit2-play26/docs/User.md
Normal file
17
samples/client/petstore/java/retrofit2-play26/docs/User.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
# User
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**username** | **String** | | [optional]
|
||||||
|
**firstName** | **String** | | [optional]
|
||||||
|
**lastName** | **String** | | [optional]
|
||||||
|
**email** | **String** | | [optional]
|
||||||
|
**password** | **String** | | [optional]
|
||||||
|
**phone** | **String** | | [optional]
|
||||||
|
**userStatus** | **Integer** | User Status | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
360
samples/client/petstore/java/retrofit2-play26/docs/UserApi.md
Normal file
360
samples/client/petstore/java/retrofit2-play26/docs/UserApi.md
Normal file
@ -0,0 +1,360 @@
|
|||||||
|
# UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**createUser**](UserApi.md#createUser) | **POST** user | Create user
|
||||||
|
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array
|
||||||
|
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array
|
||||||
|
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user
|
||||||
|
[**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name
|
||||||
|
[**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system
|
||||||
|
[**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session
|
||||||
|
[**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
<a name="createUser"></a>
|
||||||
|
# **createUser**
|
||||||
|
> createUser(user)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
User user = new User(); // User | Created user object
|
||||||
|
try {
|
||||||
|
apiInstance.createUser(user);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#createUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="createUsersWithArrayInput"></a>
|
||||||
|
# **createUsersWithArrayInput**
|
||||||
|
> createUsersWithArrayInput(user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
List<User> user = Arrays.asList(new List()); // List<User> | List of user object
|
||||||
|
try {
|
||||||
|
apiInstance.createUsersWithArrayInput(user);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**List<User>**](List.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="createUsersWithListInput"></a>
|
||||||
|
# **createUsersWithListInput**
|
||||||
|
> createUsersWithListInput(user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
List<User> user = Arrays.asList(new List()); // List<User> | List of user object
|
||||||
|
try {
|
||||||
|
apiInstance.createUsersWithListInput(user);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**List<User>**](List.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="deleteUser"></a>
|
||||||
|
# **deleteUser**
|
||||||
|
> deleteUser(username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
String username = "username_example"; // String | The name that needs to be deleted
|
||||||
|
try {
|
||||||
|
apiInstance.deleteUser(username);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#deleteUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **String**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="getUserByName"></a>
|
||||||
|
# **getUserByName**
|
||||||
|
> User getUserByName(username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
try {
|
||||||
|
User result = apiInstance.getUserByName(username);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#getUserByName");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="loginUser"></a>
|
||||||
|
# **loginUser**
|
||||||
|
> String loginUser(username, password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
String username = "username_example"; // String | The user name for login
|
||||||
|
String password = "password_example"; // String | The password for login in clear text
|
||||||
|
try {
|
||||||
|
String result = apiInstance.loginUser(username, password);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#loginUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **String**| The user name for login |
|
||||||
|
**password** | **String**| The password for login in clear text |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="logoutUser"></a>
|
||||||
|
# **logoutUser**
|
||||||
|
> logoutUser()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
try {
|
||||||
|
apiInstance.logoutUser();
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#logoutUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="updateUser"></a>
|
||||||
|
# **updateUser**
|
||||||
|
> updateUser(username, user)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import org.openapitools.client.ApiException;
|
||||||
|
//import org.openapitools.client.api.UserApi;
|
||||||
|
|
||||||
|
|
||||||
|
UserApi apiInstance = new UserApi();
|
||||||
|
String username = "username_example"; // String | name that need to be deleted
|
||||||
|
User user = new User(); // User | Updated user object
|
||||||
|
try {
|
||||||
|
apiInstance.updateUser(username, user);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling UserApi#updateUser");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **String**| name that need to be deleted |
|
||||||
|
**user** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
52
samples/client/petstore/java/retrofit2-play26/git_push.sh
Normal file
52
samples/client/petstore/java/retrofit2-play26/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="GIT_USER_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=`git remote`
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
# Uncomment to build for Android
|
||||||
|
#target = android
|
BIN
samples/client/petstore/java/retrofit2-play26/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
samples/client/petstore/java/retrofit2-play26/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
samples/client/petstore/java/retrofit2-play26/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
samples/client/petstore/java/retrofit2-play26/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#Tue May 17 23:08:05 CST 2016
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
|
160
samples/client/petstore/java/retrofit2-play26/gradlew
vendored
Normal file
160
samples/client/petstore/java/retrofit2-play26/gradlew
vendored
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
90
samples/client/petstore/java/retrofit2-play26/gradlew.bat
vendored
Normal file
90
samples/client/petstore/java/retrofit2-play26/gradlew.bat
vendored
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
295
samples/client/petstore/java/retrofit2-play26/pom.xml
Normal file
295
samples/client/petstore/java/retrofit2-play26/pom.xml
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>petstore-java-client-retrofit2-play26</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>petstore-java-client-retrofit2-play26</name>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<url>https://github.com/openapitools/openapi-generator</url>
|
||||||
|
<description>OpenAPI Java</description>
|
||||||
|
<scm>
|
||||||
|
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||||
|
<developerConnection>scm:git:git@github.com:openapitools/openapi-generator.git</developerConnection>
|
||||||
|
<url>https://github.com/openapitools/openapi-generator</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>Unlicense</name>
|
||||||
|
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>OpenAPI</name>
|
||||||
|
<email>team@openapitools.org</email>
|
||||||
|
<organization>OpenAPI</organization>
|
||||||
|
<organizationUrl>http://openapitools.org</organizationUrl>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.0.0-M1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>enforce-maven</id>
|
||||||
|
<goals>
|
||||||
|
<goal>enforce</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<requireMavenVersion>
|
||||||
|
<version>2.2.0</version>
|
||||||
|
</requireMavenVersion>
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.12</version>
|
||||||
|
<configuration>
|
||||||
|
<systemProperties>
|
||||||
|
<property>
|
||||||
|
<name>loggerPath</name>
|
||||||
|
<value>conf/log4j.properties</value>
|
||||||
|
</property>
|
||||||
|
</systemProperties>
|
||||||
|
<argLine>-Xms512m -Xmx1500m</argLine>
|
||||||
|
<parallel>methods</parallel>
|
||||||
|
<forkMode>pertest</forkMode>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- attach test jar -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
<goal>test-jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>1.10</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>add_sources</id>
|
||||||
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>add-source</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sources>
|
||||||
|
<source>
|
||||||
|
src/main/java</source>
|
||||||
|
</sources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>add_test_sources</id>
|
||||||
|
<phase>generate-test-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>add-test-source</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sources>
|
||||||
|
<source>
|
||||||
|
src/test/java</source>
|
||||||
|
</sources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.10.4</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>sign-artifacts</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<version>1.5</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>sign-artifacts</id>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>sign</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
<version>${swagger-core-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-gson</artifactId>
|
||||||
|
<version>${retrofit-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>retrofit</artifactId>
|
||||||
|
<version>${retrofit-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-scalars</artifactId>
|
||||||
|
<version>${retrofit-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.oltu.oauth2</groupId>
|
||||||
|
<artifactId>org.apache.oltu.oauth2.client</artifactId>
|
||||||
|
<version>${oltu-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.oltu.oauth2</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.gsonfire</groupId>
|
||||||
|
<artifactId>gson-fire</artifactId>
|
||||||
|
<version>${gson-fire-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.threeten</groupId>
|
||||||
|
<artifactId>threetenbp</artifactId>
|
||||||
|
<version>${threetenbp-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JSON processing: jackson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-jackson</artifactId>
|
||||||
|
<version>${retrofit-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-core</artifactId>
|
||||||
|
<version>${jackson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
<version>${jackson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>${jackson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
<version>${jackson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.typesafe.play</groupId>
|
||||||
|
<artifactId>play-ahc-ws_2.12</artifactId>
|
||||||
|
<version>${play-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>1.1.0.Final</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- test dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>${junit-version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
|
<gson-fire-version>1.8.0</gson-fire-version>
|
||||||
|
<swagger-core-version>1.5.18</swagger-core-version>
|
||||||
|
<jackson-version>2.8.10</jackson-version>
|
||||||
|
<play-version>2.6.7</play-version>
|
||||||
|
<retrofit-version>2.3.0</retrofit-version>
|
||||||
|
<threetenbp-version>1.3.5</threetenbp-version>
|
||||||
|
<oltu-version>1.0.1</oltu-version>
|
||||||
|
<junit-version>4.12</junit-version>
|
||||||
|
</properties>
|
||||||
|
</project>
|
@ -0,0 +1 @@
|
|||||||
|
sbt.version=1.2.1
|
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "petstore-java-client-retrofit2-play26"
|
@ -0,0 +1,3 @@
|
|||||||
|
<manifest package="org.openapitools.client" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application />
|
||||||
|
</manifest>
|
@ -0,0 +1,206 @@
|
|||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import retrofit2.Converter;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
import retrofit2.converter.scalars.ScalarsConverterFactory;
|
||||||
|
import retrofit2.converter.jackson.JacksonConverterFactory;
|
||||||
|
|
||||||
|
import play.libs.Json;
|
||||||
|
import play.libs.ws.WSClient;
|
||||||
|
|
||||||
|
import org.openapitools.client.Play26CallAdapterFactory;
|
||||||
|
import org.openapitools.client.Play26CallFactory;
|
||||||
|
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import org.openapitools.client.auth.ApiKeyAuth;
|
||||||
|
import org.openapitools.client.auth.Authentication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API client
|
||||||
|
*/
|
||||||
|
public class ApiClient {
|
||||||
|
|
||||||
|
/** Underlying HTTP-client */
|
||||||
|
private WSClient wsClient;
|
||||||
|
|
||||||
|
/** Creates HTTP call instances */
|
||||||
|
private Play26CallFactory callFactory;
|
||||||
|
|
||||||
|
/** Create {@link java.util.concurrent.CompletionStage} instances from HTTP calls */
|
||||||
|
private Play26CallAdapterFactory callAdapterFactory;
|
||||||
|
|
||||||
|
/** Supported auths */
|
||||||
|
private Map<String, Authentication> authentications;
|
||||||
|
|
||||||
|
/** API base path */
|
||||||
|
private String basePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
|
||||||
|
/** Default ObjectMapper */
|
||||||
|
private ObjectMapper defaultMapper;
|
||||||
|
|
||||||
|
public ApiClient(WSClient wsClient) {
|
||||||
|
this();
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiClient() {
|
||||||
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
|
authentications = new HashMap<>();
|
||||||
|
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||||
|
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||||
|
// authentications.put("http_basic_test", new HttpBasicAuth());
|
||||||
|
// authentications.put("petstore_auth", new OAuth());
|
||||||
|
// Prevent the authentications from being modified.
|
||||||
|
authentications = Collections.unmodifiableMap(authentications);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a retrofit2 client for given API interface
|
||||||
|
*/
|
||||||
|
public <S> S createService(Class<S> serviceClass) {
|
||||||
|
if(!basePath.endsWith("/")) {
|
||||||
|
basePath = basePath + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> extraHeaders = new HashMap<>();
|
||||||
|
List<Pair> extraQueryParams = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String authName : authentications.keySet()) {
|
||||||
|
Authentication auth = authentications.get(authName);
|
||||||
|
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
|
||||||
|
|
||||||
|
auth.applyToParams(extraQueryParams, extraHeaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callFactory == null) {
|
||||||
|
callFactory = new Play26CallFactory(wsClient, extraHeaders, extraQueryParams);
|
||||||
|
}
|
||||||
|
if (callAdapterFactory == null) {
|
||||||
|
callAdapterFactory = new Play26CallAdapterFactory();
|
||||||
|
}
|
||||||
|
if (defaultMapper == null) {
|
||||||
|
defaultMapper = Json.mapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Retrofit.Builder()
|
||||||
|
.baseUrl(basePath)
|
||||||
|
.addConverterFactory(new FileConverter())
|
||||||
|
.addConverterFactory(ScalarsConverterFactory.create())
|
||||||
|
.addConverterFactory(JacksonConverterFactory.create(defaultMapper))
|
||||||
|
.callFactory(callFactory)
|
||||||
|
.addCallAdapterFactory(callAdapterFactory)
|
||||||
|
.build()
|
||||||
|
.create(serviceClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API base path
|
||||||
|
*/
|
||||||
|
public ApiClient setBasePath(String basePath) {
|
||||||
|
this.basePath = basePath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get authentications (key: authentication name, value: authentication).
|
||||||
|
*/
|
||||||
|
public Map<String, Authentication> getAuthentications() {
|
||||||
|
return authentications;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get authentication for the given name.
|
||||||
|
*
|
||||||
|
* @param authName The authentication name
|
||||||
|
* @return The authentication, null if not found
|
||||||
|
*/
|
||||||
|
public Authentication getAuthentication(String authName) {
|
||||||
|
return authentications.get(authName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key value for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public ApiClient setApiKey(String apiKey) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKey(apiKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set API key prefix for the first API key authentication.
|
||||||
|
*/
|
||||||
|
public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof ApiKeyAuth) {
|
||||||
|
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("No API key authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set HTTP call instances factory
|
||||||
|
*/
|
||||||
|
public ApiClient setCallFactory(Play26CallFactory callFactory) {
|
||||||
|
this.callFactory = callFactory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set {@link java.util.concurrent.CompletionStage} instances factory
|
||||||
|
*/
|
||||||
|
public ApiClient setCallAdapterFactory(Play26CallAdapterFactory callAdapterFactory) {
|
||||||
|
this.callAdapterFactory = callAdapterFactory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set Jackson's {@link ObjectMapper}
|
||||||
|
*/
|
||||||
|
public ApiClient setObjectMapper(ObjectMapper mapper) {
|
||||||
|
this.defaultMapper = mapper;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class FileConverter extends Converter.Factory {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Converter<ResponseBody, File> responseBodyConverter(Type type,
|
||||||
|
Annotation[] annotations, Retrofit retrofit) {
|
||||||
|
|
||||||
|
if (!File.class.getTypeName().equals(type.getTypeName())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Converter<ResponseBody, File>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File convert(ResponseBody value) throws IOException {
|
||||||
|
|
||||||
|
File file = File.createTempFile("retrofit-file", ".tmp");
|
||||||
|
Files.write(Paths.get(file.getPath()), value.bytes());
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CollectionFormats {
|
||||||
|
|
||||||
|
public static class CSVParams {
|
||||||
|
|
||||||
|
protected List<String> params;
|
||||||
|
|
||||||
|
public CSVParams() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVParams(List<String> params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVParams(String... params) {
|
||||||
|
this.params = Arrays.asList(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(List<String> params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return StringUtil.join(params.toArray(new String[0]), ",");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class SSVParams extends CSVParams {
|
||||||
|
|
||||||
|
public SSVParams() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SSVParams(List<String> params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SSVParams(String... params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return StringUtil.join(params.toArray(new String[0]), " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TSVParams extends CSVParams {
|
||||||
|
|
||||||
|
public TSVParams() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public TSVParams(List<String> params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TSVParams(String... params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return StringUtil.join( params.toArray(new String[0]), "\t");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PIPESParams extends CSVParams {
|
||||||
|
|
||||||
|
public PIPESParams() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PIPESParams(List<String> params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PIPESParams(String... params) {
|
||||||
|
super(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return StringUtil.join(params.toArray(new String[0]), "|");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
|
||||||
|
public class Pair {
|
||||||
|
private String name = "";
|
||||||
|
private String value = "";
|
||||||
|
|
||||||
|
public Pair (String name, String value) {
|
||||||
|
setName(name);
|
||||||
|
setValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setName(String name) {
|
||||||
|
if (!isValidString(name)) return;
|
||||||
|
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setValue(String value) {
|
||||||
|
if (!isValidString(value)) return;
|
||||||
|
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isValidString(String arg) {
|
||||||
|
if (arg == null) return false;
|
||||||
|
if (arg.trim().isEmpty()) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,116 @@
|
|||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import retrofit2.*;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.lang.reflect.WildcardType;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
||||||
|
*/
|
||||||
|
public class Play26CallAdapterFactory extends CallAdapter.Factory {
|
||||||
|
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter = Function.identity();
|
||||||
|
|
||||||
|
public Play26CallAdapterFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallAdapterFactory(
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
||||||
|
if (!(returnType instanceof ParameterizedType)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
ParameterizedType type = (ParameterizedType) returnType;
|
||||||
|
if (type.getRawType() != CompletionStage.class) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return createAdapter((ParameterizedType) returnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CallAdapter<?, CompletionStage<?>> createAdapter(ParameterizedType returnType) {
|
||||||
|
// Get CompletionStage type argument
|
||||||
|
Type[] types = returnType.getActualTypeArguments();
|
||||||
|
if (types.length != 1) {
|
||||||
|
throw new IllegalStateException("Must be exactly one type parameter");
|
||||||
|
}
|
||||||
|
|
||||||
|
Type resultType = types[0];
|
||||||
|
Class<?> rawTypeParam = getRawType(resultType);
|
||||||
|
|
||||||
|
boolean includeResponse = false;
|
||||||
|
if (rawTypeParam == Response.class) {
|
||||||
|
if (!(resultType instanceof ParameterizedType)) {
|
||||||
|
throw new IllegalStateException("Response must be parameterized"
|
||||||
|
+ " as Response<T>");
|
||||||
|
}
|
||||||
|
resultType = ((ParameterizedType) resultType).getActualTypeArguments()[0];
|
||||||
|
includeResponse = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ValueAdapter(resultType, includeResponse, exceptionConverter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adpater that coverts values returned by API interface into CompletionStage
|
||||||
|
*/
|
||||||
|
private static final class ValueAdapter<R> implements CallAdapter<R, CompletionStage<R>> {
|
||||||
|
|
||||||
|
private final Type responseType;
|
||||||
|
private final boolean includeResponse;
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter;
|
||||||
|
|
||||||
|
ValueAdapter(Type responseType, boolean includeResponse,
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.responseType = responseType;
|
||||||
|
this.includeResponse = includeResponse;
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type responseType() {
|
||||||
|
return responseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletionStage<R> adapt(final Call<R> call) {
|
||||||
|
final CompletableFuture<R> promise = new CompletableFuture();
|
||||||
|
|
||||||
|
call.enqueue(new Callback<R>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<R> call, Response<R> response) {
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
if (includeResponse) {
|
||||||
|
promise.complete((R) response);
|
||||||
|
} else {
|
||||||
|
promise.complete(response.body());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
promise.completeExceptionally(exceptionConverter.apply(new HttpException(response)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<R> call, Throwable t) {
|
||||||
|
promise.completeExceptionally(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,245 @@
|
|||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import okhttp3.*;
|
||||||
|
import okio.Buffer;
|
||||||
|
import okio.BufferedSource;
|
||||||
|
import play.libs.ws.WSClient;
|
||||||
|
import play.libs.ws.WSRequest;
|
||||||
|
import play.libs.ws.WSResponse;
|
||||||
|
import play.libs.ws.WSRequestFilter;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@link Call} instances that invoke underlying {@link WSClient}
|
||||||
|
*/
|
||||||
|
public class Play26CallFactory implements okhttp3.Call.Factory {
|
||||||
|
|
||||||
|
/** PlayWS http client */
|
||||||
|
private final WSClient wsClient;
|
||||||
|
|
||||||
|
/** Extra headers to add to request */
|
||||||
|
private Map<String, String> extraHeaders = new HashMap<>();
|
||||||
|
|
||||||
|
/** Extra query parameters to add to request */
|
||||||
|
private List<Pair> extraQueryParams = new ArrayList<>();
|
||||||
|
|
||||||
|
/** Filters (interceptors) */
|
||||||
|
private List<WSRequestFilter> filters = new ArrayList<>();
|
||||||
|
|
||||||
|
/** Executor for WSClient */
|
||||||
|
private Executor executor;
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient, List<WSRequestFilter> filters) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
this.filters.addAll(filters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory(WSClient wsClient, Map<String, String> extraHeaders,
|
||||||
|
List<Pair> extraQueryParams) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
|
||||||
|
this.extraHeaders.putAll(extraHeaders);
|
||||||
|
this.extraQueryParams.addAll(extraQueryParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play26CallFactory withExecutor(Executor executor) {
|
||||||
|
this.executor = executor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Call newCall(Request request) {
|
||||||
|
// add extra headers
|
||||||
|
Request.Builder rb = request.newBuilder();
|
||||||
|
for (Map.Entry<String, String> header : this.extraHeaders.entrySet()) {
|
||||||
|
rb.addHeader(header.getKey(), header.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
// add extra query params
|
||||||
|
if (!this.extraQueryParams.isEmpty()) {
|
||||||
|
String newQuery = request.url().uri().getQuery();
|
||||||
|
for (Pair queryParam : this.extraQueryParams) {
|
||||||
|
String param = String.format("%s=%s", queryParam.getName(), queryParam.getValue());
|
||||||
|
if (newQuery == null) {
|
||||||
|
newQuery = param;
|
||||||
|
} else {
|
||||||
|
newQuery += "&" + param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
URI newUri;
|
||||||
|
try {
|
||||||
|
newUri = new URI(request.url().uri().getScheme(), request.url().uri().getAuthority(),
|
||||||
|
request.url().uri().getPath(), newQuery, request.url().uri().getFragment());
|
||||||
|
rb.url(newUri.toURL());
|
||||||
|
} catch (MalformedURLException | URISyntaxException e) {
|
||||||
|
throw new RuntimeException("Error while updating an url", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PlayWSCall(wsClient, this.executor, this.filters, rb.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call implementation that delegates to Play WS Client
|
||||||
|
*/
|
||||||
|
static class PlayWSCall implements Call {
|
||||||
|
|
||||||
|
private final WSClient wsClient;
|
||||||
|
private WSRequest wsRequest;
|
||||||
|
private List<WSRequestFilter> filters;
|
||||||
|
private Executor executor = java.util.concurrent.ForkJoinPool.commonPool();
|
||||||
|
|
||||||
|
private final Request request;
|
||||||
|
|
||||||
|
public PlayWSCall(WSClient wsClient, Executor executor, List<WSRequestFilter> filters, Request request) {
|
||||||
|
this.wsClient = wsClient;
|
||||||
|
this.request = request;
|
||||||
|
this.filters = filters;
|
||||||
|
|
||||||
|
if (executor != null) {
|
||||||
|
this.executor = executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Request request() {
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enqueue(final okhttp3.Callback responseCallback) {
|
||||||
|
final Call call = this;
|
||||||
|
final CompletionStage<WSResponse> promise = executeAsync();
|
||||||
|
|
||||||
|
promise.whenCompleteAsync((v, t) -> {
|
||||||
|
if (t != null) {
|
||||||
|
if (t instanceof IOException) {
|
||||||
|
responseCallback.onFailure(call, (IOException) t);
|
||||||
|
} else {
|
||||||
|
responseCallback.onFailure(call, new IOException(t));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
responseCallback.onResponse(call, PlayWSCall.this.toWSResponse(v));
|
||||||
|
} catch (Exception e) {
|
||||||
|
responseCallback.onFailure(call, new IOException(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, this.executor);
|
||||||
|
}
|
||||||
|
|
||||||
|
CompletionStage<WSResponse> executeAsync() {
|
||||||
|
try {
|
||||||
|
HttpUrl url = request.url();
|
||||||
|
wsRequest = wsClient.url(url.scheme()+ "://" + url.host() + ":" + url.port() + url.encodedPath());
|
||||||
|
url.queryParameterNames().forEach(queryParam -> {
|
||||||
|
wsRequest.addQueryParameter(queryParam, url.queryParameter(queryParam));
|
||||||
|
});
|
||||||
|
addHeaders(wsRequest);
|
||||||
|
if (request.body() != null) {
|
||||||
|
addBody(wsRequest);
|
||||||
|
}
|
||||||
|
filters.stream().forEach(f -> wsRequest.setRequestFilter(f));
|
||||||
|
|
||||||
|
return wsRequest.execute(request.method());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addHeaders(WSRequest wsRequest) {
|
||||||
|
for(Map.Entry<String, List<String>> entry : request.headers().toMultimap().entrySet()) {
|
||||||
|
List<String> values = entry.getValue();
|
||||||
|
for (String value : values) {
|
||||||
|
wsRequest.setHeader(entry.getKey(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addBody(WSRequest wsRequest) throws IOException {
|
||||||
|
MediaType mediaType = request.body().contentType();
|
||||||
|
if (mediaType != null) {
|
||||||
|
wsRequest.setContentType(mediaType.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
Buffer buffer = new Buffer();
|
||||||
|
request.body().writeTo(buffer);
|
||||||
|
wsRequest.setBody(buffer.inputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Response toWSResponse(final WSResponse r) {
|
||||||
|
final Response.Builder builder = new Response.Builder();
|
||||||
|
builder.request(request)
|
||||||
|
.code(r.getStatus())
|
||||||
|
.body(new ResponseBody() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MediaType contentType() {
|
||||||
|
return r.getSingleHeader("Content-Type")
|
||||||
|
.map(MediaType::parse)
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long contentLength() {
|
||||||
|
return r.asByteArray().length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BufferedSource source() {
|
||||||
|
return new Buffer().write(r.asByteArray());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (Map.Entry<String, List<String>> entry : r.getAllHeaders().entrySet()) {
|
||||||
|
for (String value : entry.getValue()) {
|
||||||
|
builder.addHeader(entry.getKey(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.message(r.getStatusText());
|
||||||
|
builder.protocol(Protocol.HTTP_1_1);
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response execute() throws IOException {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel() {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlayWSCall clone() {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isExecuted() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCanceled() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
||||||
|
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
||||||
|
|
||||||
|
import java.text.FieldPosition;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends ISO8601DateFormat {
|
||||||
|
|
||||||
|
// Same as ISO8601DateFormat but serializing milliseconds.
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
String value = ISO8601Utils.format(date, true);
|
||||||
|
toAppendTo.append(value);
|
||||||
|
return toAppendTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
|
||||||
|
public class StringUtil {
|
||||||
|
/**
|
||||||
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
*
|
||||||
|
* @param array The array
|
||||||
|
* @param value The value to search
|
||||||
|
* @return true if the array contains the value
|
||||||
|
*/
|
||||||
|
public static boolean containsIgnoreCase(String[] array, String value) {
|
||||||
|
for (String str : array) {
|
||||||
|
if (value == null && str == null) return true;
|
||||||
|
if (value != null && value.equalsIgnoreCase(str)) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join an array of strings with the given separator.
|
||||||
|
* <p>
|
||||||
|
* Note: This might be replaced by utility method from commons-lang or guava someday
|
||||||
|
* if one of those libraries is added as dependency.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param array The array of strings
|
||||||
|
* @param separator The separator
|
||||||
|
* @return the resulting string
|
||||||
|
*/
|
||||||
|
public static String join(String[] array, String separator) {
|
||||||
|
int len = array.length;
|
||||||
|
if (len == 0) return "";
|
||||||
|
|
||||||
|
StringBuilder out = new StringBuilder();
|
||||||
|
out.append(array[0]);
|
||||||
|
for (int i = 1; i < len; i++) {
|
||||||
|
out.append(separator).append(array[i]);
|
||||||
|
}
|
||||||
|
return out.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import org.openapitools.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface AnotherFakeApi {
|
||||||
|
/**
|
||||||
|
* To test special tags
|
||||||
|
* To test special tags and operation ID starting with number
|
||||||
|
* @param client client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
CompletionStage<Response<Client>> call123testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client client
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,190 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.openapitools.client.model.Client;
|
||||||
|
import java.io.File;
|
||||||
|
import org.openapitools.client.model.FileSchemaTestClass;
|
||||||
|
import org.threeten.bp.LocalDate;
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import org.openapitools.client.model.OuterComposite;
|
||||||
|
import org.openapitools.client.model.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface FakeApi {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer boolean types
|
||||||
|
* @param body Input boolean as post body (optional)
|
||||||
|
* @return Call<Boolean>
|
||||||
|
*/
|
||||||
|
@POST("fake/outer/boolean")
|
||||||
|
CompletionStage<Response<Boolean>> fakeOuterBooleanSerialize(
|
||||||
|
@retrofit2.http.Body Boolean body
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of object with outer number type
|
||||||
|
* @param outerComposite Input composite as post body (optional)
|
||||||
|
* @return Call<OuterComposite>
|
||||||
|
*/
|
||||||
|
@POST("fake/outer/composite")
|
||||||
|
CompletionStage<Response<OuterComposite>> fakeOuterCompositeSerialize(
|
||||||
|
@retrofit2.http.Body OuterComposite outerComposite
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer number types
|
||||||
|
* @param body Input number as post body (optional)
|
||||||
|
* @return Call<BigDecimal>
|
||||||
|
*/
|
||||||
|
@POST("fake/outer/number")
|
||||||
|
CompletionStage<Response<BigDecimal>> fakeOuterNumberSerialize(
|
||||||
|
@retrofit2.http.Body BigDecimal body
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer string types
|
||||||
|
* @param body Input string as post body (optional)
|
||||||
|
* @return Call<String>
|
||||||
|
*/
|
||||||
|
@POST("fake/outer/string")
|
||||||
|
CompletionStage<Response<String>> fakeOuterStringSerialize(
|
||||||
|
@retrofit2.http.Body String body
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* For this test, the body for this request much reference a schema named `File`.
|
||||||
|
* @param fileSchemaTestClass (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PUT("fake/body-with-file-schema")
|
||||||
|
CompletionStage<Response<Void>> testBodyWithFileSchema(
|
||||||
|
@retrofit2.http.Body FileSchemaTestClass fileSchemaTestClass
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param query (required)
|
||||||
|
* @param user (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PUT("fake/body-with-query-params")
|
||||||
|
CompletionStage<Response<Void>> testBodyWithQueryParams(
|
||||||
|
@retrofit2.http.Query("query") String query, @retrofit2.http.Body User user
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test \"client\" model
|
||||||
|
* To test \"client\" model
|
||||||
|
* @param client client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("fake")
|
||||||
|
CompletionStage<Response<Client>> testClientModel(
|
||||||
|
@retrofit2.http.Body Client client
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* @param number None (required)
|
||||||
|
* @param _double None (required)
|
||||||
|
* @param patternWithoutDelimiter None (required)
|
||||||
|
* @param _byte None (required)
|
||||||
|
* @param integer None (optional, default to null)
|
||||||
|
* @param int32 None (optional, default to null)
|
||||||
|
* @param int64 None (optional, default to null)
|
||||||
|
* @param _float None (optional, default to null)
|
||||||
|
* @param string None (optional, default to null)
|
||||||
|
* @param binary None (optional, default to null)
|
||||||
|
* @param date None (optional, default to null)
|
||||||
|
* @param dateTime None (optional, default to null)
|
||||||
|
* @param password None (optional, default to null)
|
||||||
|
* @param paramCallback None (optional, default to null)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.FormUrlEncoded
|
||||||
|
@POST("fake")
|
||||||
|
CompletionStage<Response<Void>> testEndpointParameters(
|
||||||
|
@retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test enum parameters
|
||||||
|
* To test enum parameters
|
||||||
|
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
|
||||||
|
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
|
||||||
|
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
||||||
|
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
||||||
|
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
|
||||||
|
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.FormUrlEncoded
|
||||||
|
@GET("fake")
|
||||||
|
CompletionStage<Response<Void>> testEnumParameters(
|
||||||
|
@retrofit2.http.Header("enum_header_string_array") List<String> enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List<String> enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test inline additionalProperties
|
||||||
|
*
|
||||||
|
* @param requestBody request body (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@POST("fake/inline-additionalProperties")
|
||||||
|
CompletionStage<Response<Void>> testInlineAdditionalProperties(
|
||||||
|
@retrofit2.http.Body Map<String, String> requestBody
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test json serialization of form data
|
||||||
|
*
|
||||||
|
* @param param field1 (required)
|
||||||
|
* @param param2 field2 (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.FormUrlEncoded
|
||||||
|
@GET("fake/jsonFormData")
|
||||||
|
CompletionStage<Response<Void>> testJsonFormData(
|
||||||
|
@retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import org.openapitools.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface FakeClassnameTags123Api {
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
* To test class name in snake case
|
||||||
|
* @param client client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("fake_classname_test")
|
||||||
|
CompletionStage<Response<Client>> testClassname(
|
||||||
|
@retrofit2.http.Body Client client
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,142 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import org.openapitools.client.model.ModelApiResponse;
|
||||||
|
import org.openapitools.client.model.Pet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface PetApi {
|
||||||
|
/**
|
||||||
|
* Add a new pet to the store
|
||||||
|
*
|
||||||
|
* @param pet Pet object that needs to be added to the store (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@POST("pet")
|
||||||
|
CompletionStage<Response<Void>> addPet(
|
||||||
|
@retrofit2.http.Body Pet pet
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param petId Pet id to delete (required)
|
||||||
|
* @param apiKey (optional)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@DELETE("pet/{petId}")
|
||||||
|
CompletionStage<Response<Void>> deletePet(
|
||||||
|
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds Pets by status
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
* @param status Status values that need to be considered for filter (required)
|
||||||
|
* @return Call<List<Pet>>
|
||||||
|
*/
|
||||||
|
@GET("pet/findByStatus")
|
||||||
|
CompletionStage<Response<List<Pet>>> findPetsByStatus(
|
||||||
|
@retrofit2.http.Query("status") CSVParams status
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds Pets by tags
|
||||||
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* @param tags Tags to filter by (required)
|
||||||
|
* @return Call<List<Pet>>
|
||||||
|
*/
|
||||||
|
@GET("pet/findByTags")
|
||||||
|
CompletionStage<Response<List<Pet>>> findPetsByTags(
|
||||||
|
@retrofit2.http.Query("tags") CSVParams tags
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find pet by ID
|
||||||
|
* Returns a single pet
|
||||||
|
* @param petId ID of pet to return (required)
|
||||||
|
* @return Call<Pet>
|
||||||
|
*/
|
||||||
|
@GET("pet/{petId}")
|
||||||
|
CompletionStage<Response<Pet>> getPetById(
|
||||||
|
@retrofit2.http.Path("petId") Long petId
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param pet Pet object that needs to be added to the store (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PUT("pet")
|
||||||
|
CompletionStage<Response<Void>> updatePet(
|
||||||
|
@retrofit2.http.Body Pet pet
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*
|
||||||
|
* @param petId ID of pet that needs to be updated (required)
|
||||||
|
* @param name Updated name of the pet (optional, default to null)
|
||||||
|
* @param status Updated status of the pet (optional, default to null)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.FormUrlEncoded
|
||||||
|
@POST("pet/{petId}")
|
||||||
|
CompletionStage<Response<Void>> updatePetWithForm(
|
||||||
|
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uploads an image
|
||||||
|
*
|
||||||
|
* @param petId ID of pet to update (required)
|
||||||
|
* @param additionalMetadata Additional data to pass to server (optional, default to null)
|
||||||
|
* @param file file to upload (optional, default to null)
|
||||||
|
* @return Call<ModelApiResponse>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.Multipart
|
||||||
|
@POST("pet/{petId}/uploadImage")
|
||||||
|
CompletionStage<Response<ModelApiResponse>> uploadFile(
|
||||||
|
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") MultipartBody.Part file
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uploads an image (required)
|
||||||
|
*
|
||||||
|
* @param petId ID of pet to update (required)
|
||||||
|
* @param requiredFile file to upload (required)
|
||||||
|
* @param additionalMetadata Additional data to pass to server (optional, default to null)
|
||||||
|
* @return Call<ModelApiResponse>
|
||||||
|
*/
|
||||||
|
@retrofit2.http.Multipart
|
||||||
|
@POST("fake/{petId}/uploadImageWithRequiredFile")
|
||||||
|
CompletionStage<Response<ModelApiResponse>> uploadFileWithRequiredFile(
|
||||||
|
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("requiredFile") MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import org.openapitools.client.model.Order;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface StoreApi {
|
||||||
|
/**
|
||||||
|
* Delete purchase order by ID
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* @param orderId ID of the order that needs to be deleted (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@DELETE("store/order/{order_id}")
|
||||||
|
CompletionStage<Response<Void>> deleteOrder(
|
||||||
|
@retrofit2.http.Path("order_id") String orderId
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
* @return Call<Map<String, Integer>>
|
||||||
|
*/
|
||||||
|
@GET("store/inventory")
|
||||||
|
CompletionStage<Response<Map<String, Integer>>> getInventory();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find purchase order by ID
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
* @param orderId ID of pet that needs to be fetched (required)
|
||||||
|
* @return Call<Order>
|
||||||
|
*/
|
||||||
|
@GET("store/order/{order_id}")
|
||||||
|
CompletionStage<Response<Order>> getOrderById(
|
||||||
|
@retrofit2.http.Path("order_id") Long orderId
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place an order for a pet
|
||||||
|
*
|
||||||
|
* @param order order placed for purchasing the pet (required)
|
||||||
|
* @return Call<Order>
|
||||||
|
*/
|
||||||
|
@POST("store/order")
|
||||||
|
CompletionStage<Response<Order>> placeOrder(
|
||||||
|
@retrofit2.http.Body Order order
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
package org.openapitools.client.api;
|
||||||
|
|
||||||
|
import org.openapitools.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
import org.openapitools.client.model.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface UserApi {
|
||||||
|
/**
|
||||||
|
* Create user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param user Created user object (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@POST("user")
|
||||||
|
CompletionStage<Response<Void>> createUser(
|
||||||
|
@retrofit2.http.Body User user
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param user List of user object (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@POST("user/createWithArray")
|
||||||
|
CompletionStage<Response<Void>> createUsersWithArrayInput(
|
||||||
|
@retrofit2.http.Body List<User> user
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param user List of user object (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@POST("user/createWithList")
|
||||||
|
CompletionStage<Response<Void>> createUsersWithListInput(
|
||||||
|
@retrofit2.http.Body List<User> user
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username The name that needs to be deleted (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@DELETE("user/{username}")
|
||||||
|
CompletionStage<Response<Void>> deleteUser(
|
||||||
|
@retrofit2.http.Path("username") String username
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
* @return Call<User>
|
||||||
|
*/
|
||||||
|
@GET("user/{username}")
|
||||||
|
CompletionStage<Response<User>> getUserByName(
|
||||||
|
@retrofit2.http.Path("username") String username
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
* @param username The user name for login (required)
|
||||||
|
* @param password The password for login in clear text (required)
|
||||||
|
* @return Call<String>
|
||||||
|
*/
|
||||||
|
@GET("user/login")
|
||||||
|
CompletionStage<Response<String>> loginUser(
|
||||||
|
@retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@GET("user/logout")
|
||||||
|
CompletionStage<Response<Void>> logoutUser();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updated user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username name that need to be deleted (required)
|
||||||
|
* @param user Updated user object (required)
|
||||||
|
* @return Call<Void>
|
||||||
|
*/
|
||||||
|
@PUT("user/{username}")
|
||||||
|
CompletionStage<Response<Void>> updateUser(
|
||||||
|
@retrofit2.http.Path("username") String username, @retrofit2.http.Body User user
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.auth;
|
||||||
|
|
||||||
|
import org.openapitools.client.Pair;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds ApiKey auth info
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ApiKeyAuth implements Authentication {
|
||||||
|
private final String location;
|
||||||
|
private final String paramName;
|
||||||
|
|
||||||
|
private String apiKey;
|
||||||
|
private String apiKeyPrefix;
|
||||||
|
|
||||||
|
public ApiKeyAuth(String location, String paramName) {
|
||||||
|
this.location = location;
|
||||||
|
this.paramName = paramName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParamName() {
|
||||||
|
return paramName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApiKey() {
|
||||||
|
return apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiKey(String apiKey) {
|
||||||
|
this.apiKey = apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApiKeyPrefix() {
|
||||||
|
return apiKeyPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiKeyPrefix(String apiKeyPrefix) {
|
||||||
|
this.apiKeyPrefix = apiKeyPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||||
|
if (apiKey == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String value;
|
||||||
|
if (apiKeyPrefix != null) {
|
||||||
|
value = apiKeyPrefix + " " + apiKey;
|
||||||
|
} else {
|
||||||
|
value = apiKey;
|
||||||
|
}
|
||||||
|
if ("query".equals(location)) {
|
||||||
|
queryParams.add(new Pair(paramName, value));
|
||||||
|
} else if ("header".equals(location)) {
|
||||||
|
headerParams.put(paramName, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.auth;
|
||||||
|
|
||||||
|
import org.openapitools.client.Pair;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface Authentication {
|
||||||
|
/**
|
||||||
|
* Apply authentication settings to header and query params.
|
||||||
|
*
|
||||||
|
* @param queryParams List of query parameters
|
||||||
|
* @param headerParams Map of header parameters
|
||||||
|
*/
|
||||||
|
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AdditionalPropertiesClass {
|
||||||
|
@JsonProperty("map_property")
|
||||||
|
private Map<String, String> mapProperty = null;
|
||||||
|
|
||||||
|
@JsonProperty("map_of_map_property")
|
||||||
|
private Map<String, Map<String, String>> mapOfMapProperty = null;
|
||||||
|
|
||||||
|
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
|
||||||
|
this.mapProperty = mapProperty;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||||
|
if (this.mapProperty == null) {
|
||||||
|
this.mapProperty = new HashMap<>();
|
||||||
|
}
|
||||||
|
this.mapProperty.put(key, mapPropertyItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get mapProperty
|
||||||
|
* @return mapProperty
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Map<String, String> getMapProperty() {
|
||||||
|
return mapProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMapProperty(Map<String, String> mapProperty) {
|
||||||
|
this.mapProperty = mapProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||||
|
this.mapOfMapProperty = mapOfMapProperty;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||||
|
if (this.mapOfMapProperty == null) {
|
||||||
|
this.mapOfMapProperty = new HashMap<>();
|
||||||
|
}
|
||||||
|
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get mapOfMapProperty
|
||||||
|
* @return mapOfMapProperty
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||||
|
return mapOfMapProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||||
|
this.mapOfMapProperty = mapOfMapProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
|
||||||
|
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
|
||||||
|
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(mapProperty, mapOfMapProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class AdditionalPropertiesClass {\n");
|
||||||
|
|
||||||
|
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
|
||||||
|
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animal
|
||||||
|
*/
|
||||||
|
|
||||||
|
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
|
||||||
|
@JsonSubTypes({
|
||||||
|
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
|
||||||
|
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
|
||||||
|
})
|
||||||
|
|
||||||
|
public class Animal {
|
||||||
|
@JsonProperty("className")
|
||||||
|
private String className = null;
|
||||||
|
|
||||||
|
@JsonProperty("color")
|
||||||
|
private String color = "red";
|
||||||
|
|
||||||
|
public Animal className(String className) {
|
||||||
|
this.className = className;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get className
|
||||||
|
* @return className
|
||||||
|
**/
|
||||||
|
@NotNull
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public String getClassName() {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClassName(String className) {
|
||||||
|
this.className = className;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Animal color(String color) {
|
||||||
|
this.color = color;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get color
|
||||||
|
* @return color
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(String color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Animal animal = (Animal) o;
|
||||||
|
return Objects.equals(this.className, animal.className) &&
|
||||||
|
Objects.equals(this.color, animal.color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(className, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Animal {\n");
|
||||||
|
|
||||||
|
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||||
|
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.openapitools.client.model.Animal;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AnimalFarm
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AnimalFarm extends ArrayList<Animal> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return super.equals(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(super.hashCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class AnimalFarm {\n");
|
||||||
|
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayOfArrayOfNumberOnly {
|
||||||
|
@JsonProperty("ArrayArrayNumber")
|
||||||
|
private List<List<BigDecimal>> arrayArrayNumber = null;
|
||||||
|
|
||||||
|
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||||
|
this.arrayArrayNumber = arrayArrayNumber;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||||
|
if (this.arrayArrayNumber == null) {
|
||||||
|
this.arrayArrayNumber = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayNumber
|
||||||
|
* @return arrayArrayNumber
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||||
|
return arrayArrayNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||||
|
this.arrayArrayNumber = arrayArrayNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
|
||||||
|
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(arrayArrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ArrayOfArrayOfNumberOnly {\n");
|
||||||
|
|
||||||
|
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayOfNumberOnly {
|
||||||
|
@JsonProperty("ArrayNumber")
|
||||||
|
private List<BigDecimal> arrayNumber = null;
|
||||||
|
|
||||||
|
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
|
||||||
|
this.arrayNumber = arrayNumber;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||||
|
if (this.arrayNumber == null) {
|
||||||
|
this.arrayNumber = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.arrayNumber.add(arrayNumberItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayNumber
|
||||||
|
* @return arrayNumber
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<BigDecimal> getArrayNumber() {
|
||||||
|
return arrayNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayNumber(List<BigDecimal> arrayNumber) {
|
||||||
|
this.arrayNumber = arrayNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
|
||||||
|
return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(arrayNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ArrayOfNumberOnly {\n");
|
||||||
|
|
||||||
|
sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,168 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.openapitools.client.model.ReadOnlyFirst;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayTest {
|
||||||
|
@JsonProperty("array_of_string")
|
||||||
|
private List<String> arrayOfString = null;
|
||||||
|
|
||||||
|
@JsonProperty("array_array_of_integer")
|
||||||
|
private List<List<Long>> arrayArrayOfInteger = null;
|
||||||
|
|
||||||
|
@JsonProperty("array_array_of_model")
|
||||||
|
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
|
||||||
|
|
||||||
|
public ArrayTest arrayOfString(List<String> arrayOfString) {
|
||||||
|
this.arrayOfString = arrayOfString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||||
|
if (this.arrayOfString == null) {
|
||||||
|
this.arrayOfString = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.arrayOfString.add(arrayOfStringItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayOfString
|
||||||
|
* @return arrayOfString
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<String> getArrayOfString() {
|
||||||
|
return arrayOfString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayOfString(List<String> arrayOfString) {
|
||||||
|
this.arrayOfString = arrayOfString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||||
|
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||||
|
if (this.arrayArrayOfInteger == null) {
|
||||||
|
this.arrayArrayOfInteger = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayOfInteger
|
||||||
|
* @return arrayArrayOfInteger
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<List<Long>> getArrayArrayOfInteger() {
|
||||||
|
return arrayArrayOfInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||||
|
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||||
|
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||||
|
if (this.arrayArrayOfModel == null) {
|
||||||
|
this.arrayArrayOfModel = new ArrayList<>();
|
||||||
|
}
|
||||||
|
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayOfModel
|
||||||
|
* @return arrayArrayOfModel
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||||
|
return arrayArrayOfModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||||
|
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ArrayTest arrayTest = (ArrayTest) o;
|
||||||
|
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
|
||||||
|
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
|
||||||
|
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ArrayTest {\n");
|
||||||
|
|
||||||
|
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
|
||||||
|
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
|
||||||
|
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Capitalization
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Capitalization {
|
||||||
|
@JsonProperty("smallCamel")
|
||||||
|
private String smallCamel = null;
|
||||||
|
|
||||||
|
@JsonProperty("CapitalCamel")
|
||||||
|
private String capitalCamel = null;
|
||||||
|
|
||||||
|
@JsonProperty("small_Snake")
|
||||||
|
private String smallSnake = null;
|
||||||
|
|
||||||
|
@JsonProperty("Capital_Snake")
|
||||||
|
private String capitalSnake = null;
|
||||||
|
|
||||||
|
@JsonProperty("SCA_ETH_Flow_Points")
|
||||||
|
private String scAETHFlowPoints = null;
|
||||||
|
|
||||||
|
@JsonProperty("ATT_NAME")
|
||||||
|
private String ATT_NAME = null;
|
||||||
|
|
||||||
|
public Capitalization smallCamel(String smallCamel) {
|
||||||
|
this.smallCamel = smallCamel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get smallCamel
|
||||||
|
* @return smallCamel
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getSmallCamel() {
|
||||||
|
return smallCamel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmallCamel(String smallCamel) {
|
||||||
|
this.smallCamel = smallCamel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Capitalization capitalCamel(String capitalCamel) {
|
||||||
|
this.capitalCamel = capitalCamel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get capitalCamel
|
||||||
|
* @return capitalCamel
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getCapitalCamel() {
|
||||||
|
return capitalCamel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapitalCamel(String capitalCamel) {
|
||||||
|
this.capitalCamel = capitalCamel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Capitalization smallSnake(String smallSnake) {
|
||||||
|
this.smallSnake = smallSnake;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get smallSnake
|
||||||
|
* @return smallSnake
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getSmallSnake() {
|
||||||
|
return smallSnake;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmallSnake(String smallSnake) {
|
||||||
|
this.smallSnake = smallSnake;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Capitalization capitalSnake(String capitalSnake) {
|
||||||
|
this.capitalSnake = capitalSnake;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get capitalSnake
|
||||||
|
* @return capitalSnake
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getCapitalSnake() {
|
||||||
|
return capitalSnake;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapitalSnake(String capitalSnake) {
|
||||||
|
this.capitalSnake = capitalSnake;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
|
||||||
|
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get scAETHFlowPoints
|
||||||
|
* @return scAETHFlowPoints
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getScAETHFlowPoints() {
|
||||||
|
return scAETHFlowPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScAETHFlowPoints(String scAETHFlowPoints) {
|
||||||
|
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Capitalization ATT_NAME(String ATT_NAME) {
|
||||||
|
this.ATT_NAME = ATT_NAME;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the pet
|
||||||
|
* @return ATT_NAME
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "Name of the pet ")
|
||||||
|
public String getATTNAME() {
|
||||||
|
return ATT_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setATTNAME(String ATT_NAME) {
|
||||||
|
this.ATT_NAME = ATT_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Capitalization capitalization = (Capitalization) o;
|
||||||
|
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
|
||||||
|
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
|
||||||
|
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
|
||||||
|
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
|
||||||
|
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
|
||||||
|
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Capitalization {\n");
|
||||||
|
|
||||||
|
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
|
||||||
|
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
|
||||||
|
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
|
||||||
|
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
|
||||||
|
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
|
||||||
|
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import org.openapitools.client.model.Animal;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cat
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Cat extends Animal {
|
||||||
|
@JsonProperty("declawed")
|
||||||
|
private Boolean declawed = null;
|
||||||
|
|
||||||
|
public Cat declawed(Boolean declawed) {
|
||||||
|
this.declawed = declawed;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get declawed
|
||||||
|
* @return declawed
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Boolean getDeclawed() {
|
||||||
|
return declawed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeclawed(Boolean declawed) {
|
||||||
|
this.declawed = declawed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Cat cat = (Cat) o;
|
||||||
|
return Objects.equals(this.declawed, cat.declawed) &&
|
||||||
|
super.equals(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(declawed, super.hashCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Cat {\n");
|
||||||
|
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||||
|
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.openapitools.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Category {
|
||||||
|
@JsonProperty("id")
|
||||||
|
private Long id = null;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
private String name = null;
|
||||||
|
|
||||||
|
public Category id(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get id
|
||||||
|
* @return id
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Category name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get name
|
||||||
|
* @return name
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Category category = (Category) o;
|
||||||
|
return Objects.equals(this.id, category.id) &&
|
||||||
|
Objects.equals(this.name, category.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Category {\n");
|
||||||
|
|
||||||
|
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||||
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(java.lang.Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user