forked from loafle/openapi-generator-original
[NEW API CLIENT] Rest-assured (#7492)
* Rest-assured http client has been added ApiClient has been added @Deprecated has been added for operation {{{returnType}}} has been fixed build.gradle.mustache, build.sbt.mustache, api_doc_mustache has been added Samples has been added for rest-assured Useless supporting files has been removed for rest-assured Sample has been added for rest-assured * Tests has been added * Doc and tests has been fixed, JSON.mustache moved to common
This commit is contained in:
parent
c69925b53a
commit
6debf749ae
@ -24,7 +24,7 @@
|
|||||||
## Overview
|
## Overview
|
||||||
This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:
|
This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:
|
||||||
|
|
||||||
- **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)
|
- **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)
|
||||||
- **Server stubs**: **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin**, **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra)
|
- **Server stubs**: **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin**, **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra)
|
||||||
- **API documentation generators**: **HTML**, **Confluence Wiki**
|
- **API documentation generators**: **HTML**, **Confluence Wiki**
|
||||||
- **Configuration files**: [**Apache2**](https://httpd.apache.org/)
|
- **Configuration files**: [**Apache2**](https://httpd.apache.org/)
|
||||||
@ -530,6 +530,7 @@ CONFIG OPTIONS
|
|||||||
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
|
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
|
||||||
retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
|
retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
|
||||||
google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
|
google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
|
||||||
|
rest-assured - HTTP client: rest-assured : 3.0.6. JSON processing: Gson 2.6.1. Only for Java8
|
||||||
```
|
```
|
||||||
|
|
||||||
Your config file for Java can look like
|
Your config file for Java can look like
|
||||||
|
@ -17,3 +17,4 @@
|
|||||||
./bin/java-petstore-resttemplate-withxml.sh
|
./bin/java-petstore-resttemplate-withxml.sh
|
||||||
./bin/java-petstore-resteasy.sh
|
./bin/java-petstore-resteasy.sh
|
||||||
./bin/java-petstore-google-api-client.sh
|
./bin/java-petstore-google-api-client.sh
|
||||||
|
./bin/java-petstore-rest-assured.sh
|
||||||
|
4
bin/java-petstore-rest-assured.json
Normal file
4
bin/java-petstore-rest-assured.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"library": "rest-assured",
|
||||||
|
"artifactId": "swagger-petstore-rest-assured"
|
||||||
|
}
|
35
bin/java-petstore-rest-assured.sh
Executable file
35
bin/java-petstore-rest-assured.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
|
||||||
|
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/swagger-codegen-cli/target/swagger-codegen-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn 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 -t modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured -DhideGenerationTimestamp=true"
|
||||||
|
|
||||||
|
echo "Removing files and folders under samples/client/petstore/java/rest-assured/src/main"
|
||||||
|
rm -rf samples/client/petstore/java/rest-assured/src/main
|
||||||
|
find samples/client/petstore/java/rest-assured -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
@ -39,6 +39,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
|
|
||||||
public static final String RETROFIT_1 = "retrofit";
|
public static final String RETROFIT_1 = "retrofit";
|
||||||
public static final String RETROFIT_2 = "retrofit2";
|
public static final String RETROFIT_2 = "retrofit2";
|
||||||
|
public static final String REST_ASSURED = "rest-assured";
|
||||||
|
|
||||||
protected String gradleWrapperPackage = "gradle.wrapper";
|
protected String gradleWrapperPackage = "gradle.wrapper";
|
||||||
protected boolean useRxJava = false;
|
protected boolean useRxJava = false;
|
||||||
@ -83,6 +84,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
supportedLibraries.put("resteasy", "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.8.9");
|
supportedLibraries.put("resteasy", "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.8.9");
|
||||||
supportedLibraries.put("vertx", "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.8.9");
|
supportedLibraries.put("vertx", "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.8.9");
|
||||||
supportedLibraries.put("google-api-client", "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.8.9");
|
supportedLibraries.put("google-api-client", "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.8.9");
|
||||||
|
supportedLibraries.put("rest-assured", "HTTP client: rest-assured : 3.0.6. JSON processing: Gson 2.6.1. Only for Java8");
|
||||||
|
|
||||||
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
||||||
libraryOption.setEnum(supportedLibraries);
|
libraryOption.setEnum(supportedLibraries);
|
||||||
@ -169,12 +171,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
writeOptional(outputFolder, new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
|
writeOptional(outputFolder, new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
|
||||||
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
|
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
|
||||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java"));
|
supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java"));
|
||||||
if(!"resttemplate".equals(getLibrary())) {
|
if(!("resttemplate".equals(getLibrary()) || REST_ASSURED.equals(getLibrary()))) {
|
||||||
supportingFiles.add(new SupportingFile("StringUtil.mustache", invokerFolder, "StringUtil.java"));
|
supportingFiles.add(new SupportingFile("StringUtil.mustache", invokerFolder, "StringUtil.java"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// google-api-client doesn't use the Swagger auth, because it uses Google Credential directly (HttpRequestInitializer)
|
// google-api-client doesn't use the Swagger auth, because it uses Google Credential directly (HttpRequestInitializer)
|
||||||
if (!"google-api-client".equals(getLibrary())) {
|
if (!("google-api-client".equals(getLibrary()) || REST_ASSURED.equals(getLibrary()))) {
|
||||||
supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java"));
|
supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java"));
|
||||||
supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
|
supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
|
||||||
supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java"));
|
supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java"));
|
||||||
@ -200,7 +202,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!("feign".equals(getLibrary()) || "resttemplate".equals(getLibrary()) || usesAnyRetrofitLibrary() || "google-api-client".equals(getLibrary()))) {
|
if (!("feign".equals(getLibrary()) || "resttemplate".equals(getLibrary()) || usesAnyRetrofitLibrary() || "google-api-client".equals(getLibrary()) || REST_ASSURED.equals(getLibrary()))) {
|
||||||
supportingFiles.add(new SupportingFile("apiException.mustache", invokerFolder, "ApiException.java"));
|
supportingFiles.add(new SupportingFile("apiException.mustache", invokerFolder, "ApiException.java"));
|
||||||
supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java"));
|
supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java"));
|
||||||
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
|
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
|
||||||
@ -246,6 +248,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
supportingFiles.remove(new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
|
supportingFiles.remove(new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
|
||||||
} else if ("google-api-client".equals(getLibrary())) {
|
} else if ("google-api-client".equals(getLibrary())) {
|
||||||
additionalProperties.put("jackson", "true");
|
additionalProperties.put("jackson", "true");
|
||||||
|
|
||||||
|
} else if (REST_ASSURED.equals(getLibrary())) {
|
||||||
|
additionalProperties.put("gson", "true");
|
||||||
|
apiTemplateFiles.put("api.mustache", ".java");
|
||||||
|
supportingFiles.add(new SupportingFile("ResponseSpecBuilders.mustache", invokerFolder, "ResponseSpecBuilders.java"));
|
||||||
|
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
||||||
|
supportingFiles.add(new SupportingFile("GsonObjectMapper.mustache", invokerFolder, "GsonObjectMapper.java"));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("Unknown library option (-l/--library): " + getLibrary());
|
LOGGER.error("Unknown library option (-l/--library): " + getLibrary());
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ import org.threeten.bp.format.DateTimeFormatter;
|
|||||||
{{/threetenbp}}
|
{{/threetenbp}}
|
||||||
|
|
||||||
import {{modelPackage}}.*;
|
import {{modelPackage}}.*;
|
||||||
import okio.ByteString;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
@ -56,7 +55,6 @@ public class JSON {
|
|||||||
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||||
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||||
{{/jsr310}}
|
{{/jsr310}}
|
||||||
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
|
|
||||||
|
|
||||||
public static GsonBuilder createGson() {
|
public static GsonBuilder createGson() {
|
||||||
GsonFireBuilder fireBuilder = new GsonFireBuilder()
|
GsonFireBuilder fireBuilder = new GsonFireBuilder()
|
||||||
@ -107,7 +105,6 @@ public class JSON {
|
|||||||
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
|
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
|
||||||
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
|
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
|
||||||
{{/jsr310}}
|
{{/jsr310}}
|
||||||
.registerTypeAdapter(byte[].class, byteArrayAdapter)
|
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,34 +171,6 @@ public class JSON {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gson TypeAdapter for Byte Array type
|
|
||||||
*/
|
|
||||||
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(JsonWriter out, byte[] value) throws IOException {
|
|
||||||
if (value == null) {
|
|
||||||
out.nullValue();
|
|
||||||
} else {
|
|
||||||
out.value(ByteString.of(value).base64());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public byte[] read(JsonReader in) throws IOException {
|
|
||||||
switch (in.peek()) {
|
|
||||||
case NULL:
|
|
||||||
in.nextNull();
|
|
||||||
return null;
|
|
||||||
default:
|
|
||||||
String bytesAsBase64 = in.nextString();
|
|
||||||
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
|
|
||||||
return byteString.toByteArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{{#joda}}
|
{{#joda}}
|
||||||
/**
|
/**
|
||||||
* Gson TypeAdapter for Joda DateTime type
|
* Gson TypeAdapter for Joda DateTime type
|
@ -0,0 +1,59 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import {{apiPackage}}.*;
|
||||||
|
|
||||||
|
{{#imports}}import {{import}};
|
||||||
|
{{/imports}}
|
||||||
|
|
||||||
|
{{^fullJavaUtil}}
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
{{/fullJavaUtil}}
|
||||||
|
|
||||||
|
public class ApiClient {
|
||||||
|
|
||||||
|
private final Config config;
|
||||||
|
|
||||||
|
private ApiClient(Config config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApiClient api(Config config) {
|
||||||
|
return new ApiClient(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
public {{classname}} {{classVarName}}() {
|
||||||
|
return {{classname}}.{{classVarName}}(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
|
||||||
|
public static class Config {
|
||||||
|
private Supplier<RequestSpecBuilder> baseReqSpec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use common specification for all operations
|
||||||
|
*/
|
||||||
|
public Config reqSpecSupplier(Supplier<RequestSpecBuilder> supplier) {
|
||||||
|
this.baseReqSpec = supplier;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Config apiConfig() {
|
||||||
|
return new Config();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import io.restassured.mapper.ObjectMapper;
|
||||||
|
import io.restassured.mapper.ObjectMapperDeserializationContext;
|
||||||
|
import io.restassured.mapper.ObjectMapperSerializationContext;
|
||||||
|
|
||||||
|
public class GsonObjectMapper implements ObjectMapper {
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private GsonObjectMapper() {
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GsonObjectMapper gson() {
|
||||||
|
return new GsonObjectMapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object deserialize(ObjectMapperDeserializationContext context) {
|
||||||
|
return json.deserialize(context.getDataToDeserialize().asString(), context.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object serialize(ObjectMapperSerializationContext context) {
|
||||||
|
return json.serialize(context.getObjectToSerialize());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
# {{artifactId}}
|
||||||
|
|
||||||
|
## 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>{{groupId}}</groupId>
|
||||||
|
<artifactId>{{artifactId}}</artifactId>
|
||||||
|
<version>{{artifactVersion}}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Recommendation
|
||||||
|
|
||||||
|
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||||
|
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
import io.restassured.specification.ResponseSpecification;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class ResponseSpecBuilders {
|
||||||
|
|
||||||
|
private ResponseSpecBuilders() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Function<Response, Response> validatedWith(ResponseSpecification respSpec) {
|
||||||
|
return response -> response.then().spec(respSpec).extract().response();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Function<Response, Response> validatedWith(ResponseSpecBuilder respSpec) {
|
||||||
|
return validatedWith(respSpec.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param code expected status code
|
||||||
|
* @return ResponseSpecBuilder
|
||||||
|
*/
|
||||||
|
public static ResponseSpecBuilder shouldBeCode(int code) {
|
||||||
|
return new ResponseSpecBuilder().expectStatusCode(code);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,235 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
package {{package}};
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
{{#imports}}import {{import}};
|
||||||
|
{{/imports}}
|
||||||
|
|
||||||
|
{{^fullJavaUtil}}
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
{{/fullJavaUtil}}
|
||||||
|
import {{invokerPackage}}.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class {{classname}} {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private {{classname}}(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static {{classname}} {{classVarName}}(RequestSpecBuilder reqSpec) {
|
||||||
|
return new {{classname}}(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
|
||||||
|
{{#isDeprecated}}
|
||||||
|
@Deprecated
|
||||||
|
{{/isDeprecated}}
|
||||||
|
public {{operationIdCamelCase}}Oper {{operationId}}() {
|
||||||
|
return new {{operationIdCamelCase}}Oper(reqSpec);
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return {{classname}}
|
||||||
|
*/
|
||||||
|
public {{classname}} setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
*
|
||||||
|
{{#allParams}}
|
||||||
|
* @see #{{#isPathParam}}{{paramName}}Path{{/isPathParam}}{{#isQueryParam}}{{paramName}}Query{{/isQueryParam}}{{#isFormParam}}{{^isFile}}{{paramName}}Form{{/isFile}}{{#isFile}}{{paramName}}MultiPart{{/isFile}}{{/isFormParam}}{{#isHeaderParam}}{{paramName}}Header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
{{#returnType}}
|
||||||
|
* return {{{returnType}}}
|
||||||
|
{{/returnType}}
|
||||||
|
{{#isDeprecated}}
|
||||||
|
* @deprecated
|
||||||
|
{{/isDeprecated}}
|
||||||
|
{{#externalDocs}}
|
||||||
|
* {{description}}
|
||||||
|
* @see <a href="{{url}}">{{summary}} Documentation</a>
|
||||||
|
{{/externalDocs}}
|
||||||
|
*/
|
||||||
|
{{#isDeprecated}}
|
||||||
|
@Deprecated
|
||||||
|
{{/isDeprecated}}
|
||||||
|
public class {{operationIdCamelCase}}Oper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "{{path}}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public {{operationIdCamelCase}}Oper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
{{#vendorExtensions}}
|
||||||
|
{{#x-contentType}}
|
||||||
|
reqSpec.setContentType("{{x-contentType}}");
|
||||||
|
{{/x-contentType}}
|
||||||
|
{{#x-accepts}}
|
||||||
|
reqSpec.setAccept("{{x-accepts}}");
|
||||||
|
{{/x-accepts}}
|
||||||
|
{{/vendorExtensions}}
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public {{operationIdCamelCase}}Oper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
{{#vendorExtensions}}
|
||||||
|
{{#x-contentType}}
|
||||||
|
reqSpec.setContentType("{{x-contentType}}");
|
||||||
|
{{/x-contentType}}
|
||||||
|
{{#x-accepts}}
|
||||||
|
reqSpec.setAccept("{{x-accepts}}");
|
||||||
|
{{/x-accepts}}
|
||||||
|
{{/vendorExtensions}}
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {{httpMethod}} {{path}}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request({{httpMethod}}, REQ_URI));
|
||||||
|
}
|
||||||
|
{{#returnType}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {{httpMethod}} {{path}}
|
||||||
|
* @return {{{returnType}}}
|
||||||
|
*/
|
||||||
|
public {{{returnType}}} executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
{{/returnType}}
|
||||||
|
{{#bodyParams}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper body({{{dataType}}} {{paramName}}) {
|
||||||
|
reqSpec.setBody(getJSON().serialize({{paramName}}));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/bodyParams}}
|
||||||
|
{{#headerParams}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper {{paramName}}Header(String {{paramName}}) {
|
||||||
|
reqSpec.addHeader("{{baseName}}", {{paramName}});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/headerParams}}
|
||||||
|
{{#pathParams}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper {{paramName}}Path(Object {{paramName}}) {
|
||||||
|
reqSpec.addPathParam("{{baseName}}", {{paramName}});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/pathParams}}
|
||||||
|
{{#queryParams}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper {{paramName}}Query(Object... {{paramName}}) {
|
||||||
|
reqSpec.addQueryParam("{{baseName}}", {{paramName}});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/queryParams}}
|
||||||
|
{{#formParams}}
|
||||||
|
{{^isFile}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper {{paramName}}Form(Object... {{paramName}}) {
|
||||||
|
reqSpec.addFormParam("{{baseName}}", {{paramName}});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/isFile}}
|
||||||
|
{{/formParams}}
|
||||||
|
{{#formParams}}
|
||||||
|
{{#isFile}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It will assume that the control name is file and the <content-type> is <application/octet-stream>
|
||||||
|
* @see #reqSpec for customise
|
||||||
|
* @param {{paramName}} ({{{dataType}}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper {{paramName}}MultiPart({{{dataType}}} {{paramName}}) {
|
||||||
|
reqSpec.addMultiPart({{paramName}});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
{{/isFile}}
|
||||||
|
{{/formParams}}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public {{operationIdCamelCase}}Oper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
# {{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
<a name="{{operationId}}"></a>
|
||||||
|
# **{{operationId}}**
|
||||||
|
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
|
|
||||||
|
{{summary}}{{#notes}}
|
||||||
|
|
||||||
|
{{notes}}{{/notes}}
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import {{invokerPackage}}.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
{{classname}} api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("{{basePath}}"))).{{classVarName}}();
|
||||||
|
|
||||||
|
api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}}
|
||||||
|
.{{paramName}}Path({{paramName}}){{/isPathParam}}{{#isQueryParam}}
|
||||||
|
.{{paramName}}Query({{paramName}}){{/isQueryParam}}{{#isFormParam}}{{^isFile}}
|
||||||
|
.{{paramName}}Form({{paramName}}){{/isFile}}{{/isFormParam}}{{#isFormParam}}{{#isFile}}
|
||||||
|
.{{paramName}}MultiPart({{paramName}}){{/isFile}}{{/isFormParam}}{{#isHeaderParam}}
|
||||||
|
.{{paramName}}Header({{paramName}}){{/isHeaderParam}}{{#isBodyParam}}
|
||||||
|
.body({{paramName}}){{/isBodyParam}}{{/required}}{{/allParams}}.execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,65 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
package {{package}};
|
||||||
|
|
||||||
|
{{#imports}}import {{import}};
|
||||||
|
{{/imports}}
|
||||||
|
import {{invokerPackage}}.ApiClient;
|
||||||
|
import {{apiPackage}}.{{classname}};
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
|
||||||
|
{{^fullJavaUtil}}
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
{{/fullJavaUtil}}
|
||||||
|
import static io.restassured.config.ObjectMapperConfig.objectMapperConfig;
|
||||||
|
import static io.restassured.config.RestAssuredConfig.config;
|
||||||
|
import static {{invokerPackage}}.GsonObjectMapper.gson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API tests for {{classname}}
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
public class {{classname}}Test {
|
||||||
|
|
||||||
|
private {{classname}} api;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void createApi() {
|
||||||
|
api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder().setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper(gson())))
|
||||||
|
.addFilter(new ErrorLoggingFilter())
|
||||||
|
.setBaseUri("{{{basePath}}}"))).{{classVarName}}();
|
||||||
|
}
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
|
||||||
|
{{#responses}}
|
||||||
|
/**
|
||||||
|
* {{message}}
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void shouldSee{{code}}After{{operationIdCamelCase}}() {
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isHeaderParam}}String {{paramName}} = null;{{/isHeaderParam}}{{^isHeaderParam}}{{{dataType}}} {{paramName}} = null;{{/isHeaderParam}}
|
||||||
|
{{/allParams}}
|
||||||
|
api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}}
|
||||||
|
.{{paramName}}Path({{paramName}}){{/isPathParam}}{{#isQueryParam}}
|
||||||
|
.{{paramName}}Query({{paramName}}){{/isQueryParam}}{{#isFormParam}}{{^isFile}}
|
||||||
|
.{{paramName}}Form({{paramName}}){{/isFile}}{{/isFormParam}}{{#isFormParam}}{{#isFile}}
|
||||||
|
.{{paramName}}MultiPart({{paramName}}){{/isFile}}{{/isFormParam}}{{#isHeaderParam}}
|
||||||
|
.{{paramName}}Header({{paramName}}){{/isHeaderParam}}{{#isBodyParam}}
|
||||||
|
.body({{paramName}}){{/isBodyParam}}{{/required}}{{/allParams}}.execute(r -> r.prettyPeek());
|
||||||
|
// TODO: test validations
|
||||||
|
}
|
||||||
|
|
||||||
|
{{/responses}}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
}
|
@ -0,0 +1,122 @@
|
|||||||
|
apply plugin: 'idea'
|
||||||
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
|
group = '{{groupId}}'
|
||||||
|
version = '{{artifactVersion}}'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 23
|
||||||
|
buildToolsVersion '23.0.2'
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 22
|
||||||
|
}
|
||||||
|
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 = '{{artifactId}}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execute(type:JavaExec) {
|
||||||
|
main = System.getProperty('mainClass')
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
swagger_annotations_version = "1.5.15"
|
||||||
|
rest_assured_version = "3.0.6"
|
||||||
|
junit_version = "4.12"
|
||||||
|
gson_version = "2.6.1"
|
||||||
|
gson_fire_version = "1.8.2"
|
||||||
|
{{#joda}}
|
||||||
|
jodatime_version = "2.9.9"
|
||||||
|
{{/joda}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
threetenbp_version = "1.3.5"
|
||||||
|
{{/threetenbp}}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
|
compile "io.rest-assured:scala-support:$rest_assured_version"
|
||||||
|
compile "io.gsonfire:gson-fire:$gson_fire_version"
|
||||||
|
{{#joda}}
|
||||||
|
compile "joda-time:joda-time:$jodatime_version"
|
||||||
|
compile 'com.google.code.gson:gson:$gson_version'
|
||||||
|
{{/joda}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
compile "org.threeten:threetenbp:$threetenbp_version"
|
||||||
|
{{/threetenbp}}
|
||||||
|
testCompile "junit:junit:$junit_version"
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization := "{{groupId}}",
|
||||||
|
name := "{{artifactId}}",
|
||||||
|
version := "{{artifactVersion}}",
|
||||||
|
scalaVersion := "2.11.4",
|
||||||
|
scalacOptions ++= Seq("-feature"),
|
||||||
|
javacOptions in compile ++= Seq("-Xlint:deprecation"),
|
||||||
|
publishArtifact in (Compile, packageDoc) := false,
|
||||||
|
resolvers += Resolver.mavenLocal,
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
"io.swagger" % "swagger-annotations" % "1.5.15",
|
||||||
|
"io.rest-assured" % "scala-support" % "3.0.6"
|
||||||
|
"com.google.code.gson" % "gson" % "2.6.1",
|
||||||
|
"io.gsonfire" % "gson-fire" % "1.8.2" % "compile",
|
||||||
|
{{#joda}}
|
||||||
|
"joda-time" % "joda-time" % "2.9.9" % "compile",
|
||||||
|
{{/joda}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
|
||||||
|
{{/threetenbp}}
|
||||||
|
"junit" % "junit" % "4.12" % "test",
|
||||||
|
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,256 @@
|
|||||||
|
<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>{{groupId}}</groupId>
|
||||||
|
<artifactId>{{artifactId}}</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>{{artifactId}}</name>
|
||||||
|
<version>{{artifactVersion}}</version>
|
||||||
|
<url>{{artifactUrl}}</url>
|
||||||
|
<description>{{artifactDescription}}</description>
|
||||||
|
<scm>
|
||||||
|
<connection>{{scmConnection}}</connection>
|
||||||
|
<developerConnection>{{scmDeveloperConnection}}</developerConnection>
|
||||||
|
<url>{{scmUrl}}</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>{{licenseName}}</name>
|
||||||
|
<url>{{licenseUrl}}</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>{{developerName}}</name>
|
||||||
|
<email>{{developerEmail}}</email>
|
||||||
|
<organization>{{developerOrganization}}</organization>
|
||||||
|
<organizationUrl>{{developerOrganizationUrl}}</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>
|
||||||
|
<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-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</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>io.rest-assured</groupId>
|
||||||
|
<artifactId>rest-assured</artifactId>
|
||||||
|
<version>${rest-assured.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>${gson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{#joda}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>joda-time</groupId>
|
||||||
|
<artifactId>joda-time</artifactId>
|
||||||
|
<version>${jodatime-version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{/joda}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.threeten</groupId>
|
||||||
|
<artifactId>threetenbp</artifactId>
|
||||||
|
<version>${threetenbp-version}</version>
|
||||||
|
</dependency>
|
||||||
|
{{/threetenbp}}
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.gsonfire</groupId>
|
||||||
|
<artifactId>gson-fire</artifactId>
|
||||||
|
<version>${gson-fire-version}</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>
|
||||||
|
<swagger-core-version>1.5.15</swagger-core-version>
|
||||||
|
<rest-assured.version>3.0.6</rest-assured.version>
|
||||||
|
<gson-version>2.6.1</gson-version>
|
||||||
|
<gson-fire-version>1.8.2</gson-fire-version>
|
||||||
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
|
{{#joda}}
|
||||||
|
<jodatime-version>2.9.9</jodatime-version>
|
||||||
|
{{/joda}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
<threetenbp-version>1.3.5</threetenbp-version>
|
||||||
|
{{/threetenbp}}
|
||||||
|
<junit-version>4.12</junit-version>
|
||||||
|
</properties>
|
||||||
|
</project>
|
21
samples/client/petstore/java/rest-assured/.gitignore
vendored
Normal file
21
samples/client/petstore/java/rest-assured/.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 @@
|
|||||||
|
# Swagger Codegen Ignore
|
||||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
# 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 Swagger Codgen 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 @@
|
|||||||
|
2.4.0-SNAPSHOT
|
17
samples/client/petstore/java/rest-assured/.travis.yml
Normal file
17
samples/client/petstore/java/rest-assured/.travis.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
#
|
||||||
|
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
|
43
samples/client/petstore/java/rest-assured/README.md
Normal file
43
samples/client/petstore/java/rest-assured/README.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# swagger-petstore-rest-assured
|
||||||
|
|
||||||
|
## 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>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-petstore-rest-assured</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Recommendation
|
||||||
|
|
||||||
|
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
apiteam@swagger.io
|
||||||
|
|
||||||
|
|
111
samples/client/petstore/java/rest-assured/build.gradle
Normal file
111
samples/client/petstore/java/rest-assured/build.gradle
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
apply plugin: 'idea'
|
||||||
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
|
group = 'io.swagger'
|
||||||
|
version = '1.0.0'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 23
|
||||||
|
buildToolsVersion '23.0.2'
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 22
|
||||||
|
}
|
||||||
|
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 = 'swagger-petstore-rest-assured'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execute(type:JavaExec) {
|
||||||
|
main = System.getProperty('mainClass')
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
swagger_annotations_version = "1.5.15"
|
||||||
|
rest_assured_version = "3.0.6"
|
||||||
|
junit_version = "4.12"
|
||||||
|
gson_version = "2.6.1"
|
||||||
|
gson_fire_version = "1.8.2"
|
||||||
|
threetenbp_version = "1.3.5"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
|
compile "io.rest-assured:scala-support:$rest_assured_version"
|
||||||
|
compile "io.gsonfire:gson-fire:$gson_fire_version"
|
||||||
|
compile "org.threeten:threetenbp:$threetenbp_version"
|
||||||
|
testCompile "junit:junit:$junit_version"
|
||||||
|
}
|
20
samples/client/petstore/java/rest-assured/build.sbt
Normal file
20
samples/client/petstore/java/rest-assured/build.sbt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization := "io.swagger",
|
||||||
|
name := "swagger-petstore-rest-assured",
|
||||||
|
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(
|
||||||
|
"io.swagger" % "swagger-annotations" % "1.5.15",
|
||||||
|
"io.rest-assured" % "scala-support" % "3.0.6"
|
||||||
|
"com.google.code.gson" % "gson" % "2.6.1",
|
||||||
|
"io.gsonfire" % "gson-fire" % "1.8.2" % "compile",
|
||||||
|
"org.threeten" % "threetenbp" % "1.3.5" % "compile",
|
||||||
|
"junit" % "junit" % "4.12" % "test",
|
||||||
|
"com.novocode" % "junit-interface" % "0.10" % "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/rest-assured/docs/Animal.md
Normal file
11
samples/client/petstore/java/rest-assured/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,51 @@
|
|||||||
|
# AnotherFakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
|
||||||
|
|
||||||
|
<a name="testSpecialTags"></a>
|
||||||
|
# **testSpecialTags**
|
||||||
|
> Client testSpecialTags(body)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake();
|
||||||
|
|
||||||
|
api.testSpecialTags()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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]
|
||||||
|
|
||||||
|
|
||||||
|
|
12
samples/client/petstore/java/rest-assured/docs/ArrayTest.md
Normal file
12
samples/client/petstore/java/rest-assured/docs/ArrayTest.md
Normal file
@ -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/rest-assured/docs/Cat.md
Normal file
10
samples/client/petstore/java/rest-assured/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/java/rest-assured/docs/Category.md
Normal file
11
samples/client/petstore/java/rest-assured/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/rest-assured/docs/ClassModel.md
Normal file
10
samples/client/petstore/java/rest-assured/docs/ClassModel.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# ClassModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/rest-assured/docs/Client.md
Normal file
10
samples/client/petstore/java/rest-assured/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Client
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/rest-assured/docs/Dog.md
Normal file
10
samples/client/petstore/java/rest-assured/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
27
samples/client/petstore/java/rest-assured/docs/EnumArrays.md
Normal file
27
samples/client/petstore/java/rest-assured/docs/EnumArrays.md
Normal file
@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
|
14
samples/client/petstore/java/rest-assured/docs/EnumClass.md
Normal file
14
samples/client/petstore/java/rest-assured/docs/EnumClass.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# EnumClass
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `_ABC` (value: `"_abc"`)
|
||||||
|
|
||||||
|
* `_EFG` (value: `"-efg"`)
|
||||||
|
|
||||||
|
* `_XYZ_` (value: `"(xyz)"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
38
samples/client/petstore/java/rest-assured/docs/EnumTest.md
Normal file
38
samples/client/petstore/java/rest-assured/docs/EnumTest.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
# EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
|
||||||
|
**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="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
|
||||||
|
|
||||||
|
|
||||||
|
|
415
samples/client/petstore/java/rest-assured/docs/FakeApi.md
Normal file
415
samples/client/petstore/java/rest-assured/docs/FakeApi.md
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
# 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 |
|
||||||
|
[**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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Boolean**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="fakeOuterCompositeSerialize"></a>
|
||||||
|
# **fakeOuterCompositeSerialize**
|
||||||
|
> OuterComposite fakeOuterCompositeSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of object with outer number type
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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**: Not defined
|
||||||
|
|
||||||
|
<a name="fakeOuterNumberSerialize"></a>
|
||||||
|
# **fakeOuterNumberSerialize**
|
||||||
|
> BigDecimal fakeOuterNumberSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer number types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.fakeOuterNumberSerialize().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**BigDecimal**](BigDecimal.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="fakeOuterStringSerialize"></a>
|
||||||
|
# **fakeOuterStringSerialize**
|
||||||
|
> String fakeOuterStringSerialize(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer string types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.fakeOuterStringSerialize().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**String**](String.md)| Input string as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
<a name="testClientModel"></a>
|
||||||
|
# **testClientModel**
|
||||||
|
> Client testClientModel(body)
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.testClientModel()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.testEndpointParameters()
|
||||||
|
.numberForm(number)
|
||||||
|
._doubleForm(_double)
|
||||||
|
.patternWithoutDelimiterForm(patternWithoutDelimiter)
|
||||||
|
._byteForm(_byte).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**number** | **BigDecimal**| None |
|
||||||
|
**_double** | **Double**| None |
|
||||||
|
**patternWithoutDelimiter** | **String**| None |
|
||||||
|
**_byte** | **byte[]**| None |
|
||||||
|
**integer** | **Integer**| None | [optional]
|
||||||
|
**int32** | **Integer**| None | [optional]
|
||||||
|
**int64** | **Long**| None | [optional]
|
||||||
|
**_float** | **Float**| None | [optional]
|
||||||
|
**string** | **String**| None | [optional]
|
||||||
|
**binary** | **byte[]**| None | [optional]
|
||||||
|
**date** | **LocalDate**| None | [optional]
|
||||||
|
**dateTime** | **OffsetDateTime**| None | [optional]
|
||||||
|
**password** | **String**| None | [optional]
|
||||||
|
**paramCallback** | **String**| None | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_basic_test](../README.md#http_basic_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||||
|
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||||
|
|
||||||
|
<a name="testEnumParameters"></a>
|
||||||
|
# **testEnumParameters**
|
||||||
|
> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble)
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.testEnumParameters().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
|
||||||
|
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||||
|
**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]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: */*
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
<a name="testInlineAdditionalProperties"></a>
|
||||||
|
# **testInlineAdditionalProperties**
|
||||||
|
> testInlineAdditionalProperties(param)
|
||||||
|
|
||||||
|
test inline additionalProperties
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.testInlineAdditionalProperties()
|
||||||
|
.body(param).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | **Object**| 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||||
|
|
||||||
|
api.testJsonFormData()
|
||||||
|
.paramForm(param)
|
||||||
|
.param2Form(param2).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | **String**| field1 |
|
||||||
|
**param2** | **String**| field2 |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
# 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(body)
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
FakeClassnameTags123Api api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).fakeClassnameTags123();
|
||||||
|
|
||||||
|
api.testClassname()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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
|
||||||
|
|
22
samples/client/petstore/java/rest-assured/docs/FormatTest.md
Normal file
22
samples/client/petstore/java/rest-assured/docs/FormatTest.md
Normal file
@ -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** | **byte[]** | | [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]
|
||||||
|
|
||||||
|
|
||||||
|
|
19
samples/client/petstore/java/rest-assured/docs/MapTest.md
Normal file
19
samples/client/petstore/java/rest-assured/docs/MapTest.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
# MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||||
|
**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [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/rest-assured/docs/Name.md
Normal file
13
samples/client/petstore/java/rest-assured/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]
|
||||||
|
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/java/rest-assured/docs/NumberOnly.md
Normal file
10
samples/client/petstore/java/rest-assured/docs/NumberOnly.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# NumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/rest-assured/docs/Order.md
Normal file
24
samples/client/petstore/java/rest-assured/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]
|
||||||
|
|
||||||
|
|
||||||
|
|
14
samples/client/petstore/java/rest-assured/docs/OuterEnum.md
Normal file
14
samples/client/petstore/java/rest-assured/docs/OuterEnum.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# OuterEnum
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `PLACED` (value: `"placed"`)
|
||||||
|
|
||||||
|
* `APPROVED` (value: `"approved"`)
|
||||||
|
|
||||||
|
* `DELIVERED` (value: `"delivered"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
24
samples/client/petstore/java/rest-assured/docs/Pet.md
Normal file
24
samples/client/petstore/java/rest-assured/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"
|
||||||
|
|
||||||
|
|
||||||
|
|
357
samples/client/petstore/java/rest-assured/docs/PetApi.md
Normal file
357
samples/client/petstore/java/rest-assured/docs/PetApi.md
Normal file
@ -0,0 +1,357 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="addPet"></a>
|
||||||
|
# **addPet**
|
||||||
|
> addPet(body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.addPet()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="deletePet"></a>
|
||||||
|
# **deletePet**
|
||||||
|
> deletePet(petId, apiKey)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.deletePet()
|
||||||
|
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: application/xml, application/json
|
||||||
|
|
||||||
|
<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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.findPetsByStatus()
|
||||||
|
.statusQuery(status).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.findPetsByTags()
|
||||||
|
.tagsQuery(tags).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.getPetById()
|
||||||
|
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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(body)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.updatePet()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="updatePetWithForm"></a>
|
||||||
|
# **updatePetWithForm**
|
||||||
|
> updatePetWithForm(petId, name, status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.updatePetWithForm()
|
||||||
|
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet that needs to be updated |
|
||||||
|
**name** | **String**| Updated name of the pet | [optional]
|
||||||
|
**status** | **String**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="uploadFile"></a>
|
||||||
|
# **uploadFile**
|
||||||
|
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||||
|
|
||||||
|
api.uploadFile()
|
||||||
|
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Long**| ID of pet to update |
|
||||||
|
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **File**| file to upload | [optional]
|
||||||
|
|
||||||
|
### 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]
|
||||||
|
|
||||||
|
|
||||||
|
|
176
samples/client/petstore/java/rest-assured/docs/StoreApi.md
Normal file
176
samples/client/petstore/java/rest-assured/docs/StoreApi.md
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
# 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
|
||||||
|
|
||||||
|
api.deleteOrder()
|
||||||
|
.orderIdPath(orderId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: application/xml, application/json
|
||||||
|
|
||||||
|
<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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
|
||||||
|
|
||||||
|
api.getInventory().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
|
||||||
|
|
||||||
|
api.getOrderById()
|
||||||
|
.orderIdPath(orderId).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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(body)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
|
||||||
|
|
||||||
|
api.placeOrder()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**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
|
||||||
|
|
11
samples/client/petstore/java/rest-assured/docs/Tag.md
Normal file
11
samples/client/petstore/java/rest-assured/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/rest-assured/docs/User.md
Normal file
17
samples/client/petstore/java/rest-assured/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]
|
||||||
|
|
||||||
|
|
||||||
|
|
352
samples/client/petstore/java/rest-assured/docs/UserApi.md
Normal file
352
samples/client/petstore/java/rest-assured/docs/UserApi.md
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
# 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(body)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.createUser()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="createUsersWithArrayInput"></a>
|
||||||
|
# **createUsersWithArrayInput**
|
||||||
|
> createUsersWithArrayInput(body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.createUsersWithArrayInput()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="createUsersWithListInput"></a>
|
||||||
|
# **createUsersWithListInput**
|
||||||
|
> createUsersWithListInput(body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.createUsersWithListInput()
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="deleteUser"></a>
|
||||||
|
# **deleteUser**
|
||||||
|
> deleteUser(username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.deleteUser()
|
||||||
|
.usernamePath(username).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="getUserByName"></a>
|
||||||
|
# **getUserByName**
|
||||||
|
> User getUserByName(username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.getUserByName()
|
||||||
|
.usernamePath(username).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.loginUser()
|
||||||
|
.usernameQuery(username)
|
||||||
|
.passwordQuery(password).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.logoutUser().execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: application/xml, application/json
|
||||||
|
|
||||||
|
<a name="updateUser"></a>
|
||||||
|
# **updateUser**
|
||||||
|
> updateUser(username, body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
|
//import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||||
|
|
||||||
|
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||||
|
() -> new RequestSpecBuilder()
|
||||||
|
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
|
||||||
|
|
||||||
|
api.updateUser()
|
||||||
|
.usernamePath(username)
|
||||||
|
.body(body).execute(r -> r.prettyPeek());
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **String**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
52
samples/client/petstore/java/rest-assured/git_push.sh
Normal file
52
samples/client/petstore/java/rest-assured/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 swagger-petstore-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/rest-assured/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
samples/client/petstore/java/rest-assured/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/rest-assured/gradlew
vendored
Normal file
160
samples/client/petstore/java/rest-assured/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/rest-assured/gradlew.bat
vendored
Normal file
90
samples/client/petstore/java/rest-assured/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
|
242
samples/client/petstore/java/rest-assured/pom.xml
Normal file
242
samples/client/petstore/java/rest-assured/pom.xml
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
<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>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-petstore-rest-assured</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>swagger-petstore-rest-assured</name>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<url>https://github.com/swagger-api/swagger-codegen</url>
|
||||||
|
<description>Swagger Java</description>
|
||||||
|
<scm>
|
||||||
|
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
|
||||||
|
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
|
||||||
|
<url>https://github.com/swagger-api/swagger-codegen</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>Swagger</name>
|
||||||
|
<email>apiteam@swagger.io</email>
|
||||||
|
<organization>Swagger</organization>
|
||||||
|
<organizationUrl>http://swagger.io</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>
|
||||||
|
<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-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</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>io.rest-assured</groupId>
|
||||||
|
<artifactId>rest-assured</artifactId>
|
||||||
|
<version>${rest-assured.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>${gson-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.threeten</groupId>
|
||||||
|
<artifactId>threetenbp</artifactId>
|
||||||
|
<version>${threetenbp-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.gsonfire</groupId>
|
||||||
|
<artifactId>gson-fire</artifactId>
|
||||||
|
<version>${gson-fire-version}</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>
|
||||||
|
<swagger-core-version>1.5.15</swagger-core-version>
|
||||||
|
<rest-assured.version>3.0.6</rest-assured.version>
|
||||||
|
<gson-version>2.6.1</gson-version>
|
||||||
|
<gson-fire-version>1.8.2</gson-fire-version>
|
||||||
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
|
<threetenbp-version>1.3.5</threetenbp-version>
|
||||||
|
<junit-version>4.12</junit-version>
|
||||||
|
</properties>
|
||||||
|
</project>
|
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "swagger-petstore-rest-assured"
|
@ -0,0 +1,3 @@
|
|||||||
|
<manifest package="io.swagger.client" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application />
|
||||||
|
</manifest>
|
@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import io.swagger.client.api.*;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public class ApiClient {
|
||||||
|
|
||||||
|
private final Config config;
|
||||||
|
|
||||||
|
private ApiClient(Config config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApiClient api(Config config) {
|
||||||
|
return new ApiClient(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnotherFakeApi anotherFake() {
|
||||||
|
return AnotherFakeApi.anotherFake(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
public FakeApi fake() {
|
||||||
|
return FakeApi.fake(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
public FakeClassnameTags123Api fakeClassnameTags123() {
|
||||||
|
return FakeClassnameTags123Api.fakeClassnameTags123(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
public PetApi pet() {
|
||||||
|
return PetApi.pet(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
public StoreApi store() {
|
||||||
|
return StoreApi.store(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
public UserApi user() {
|
||||||
|
return UserApi.user(config.baseReqSpec.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Config {
|
||||||
|
private Supplier<RequestSpecBuilder> baseReqSpec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use common specification for all operations
|
||||||
|
*/
|
||||||
|
public Config reqSpecSupplier(Supplier<RequestSpecBuilder> supplier) {
|
||||||
|
this.baseReqSpec = supplier;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Config apiConfig() {
|
||||||
|
return new Config();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import io.restassured.mapper.ObjectMapper;
|
||||||
|
import io.restassured.mapper.ObjectMapperDeserializationContext;
|
||||||
|
import io.restassured.mapper.ObjectMapperSerializationContext;
|
||||||
|
|
||||||
|
public class GsonObjectMapper implements ObjectMapper {
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private GsonObjectMapper() {
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GsonObjectMapper gson() {
|
||||||
|
return new GsonObjectMapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object deserialize(ObjectMapperDeserializationContext context) {
|
||||||
|
return json.deserialize(context.getDataToDeserialize().asString(), context.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object serialize(ObjectMapperSerializationContext context) {
|
||||||
|
return json.serialize(context.getObjectToSerialize());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,374 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
import com.google.gson.TypeAdapter;
|
||||||
|
import com.google.gson.internal.bind.util.ISO8601Utils;
|
||||||
|
import com.google.gson.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import io.gsonfire.GsonFireBuilder;
|
||||||
|
import io.gsonfire.TypeSelector;
|
||||||
|
import org.threeten.bp.LocalDate;
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import org.threeten.bp.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
import io.swagger.client.model.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.ParsePosition;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class JSON {
|
||||||
|
private Gson gson;
|
||||||
|
private boolean isLenientOnJson = false;
|
||||||
|
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
|
||||||
|
private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
|
||||||
|
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||||
|
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||||
|
|
||||||
|
public static GsonBuilder createGson() {
|
||||||
|
GsonFireBuilder fireBuilder = new GsonFireBuilder()
|
||||||
|
.registerTypeSelector(Animal.class, new TypeSelector() {
|
||||||
|
@Override
|
||||||
|
public Class getClassForElement(JsonElement readElement) {
|
||||||
|
Map classByDiscriminatorValue = new HashMap();
|
||||||
|
classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
|
||||||
|
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
|
||||||
|
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
|
||||||
|
return getClassByDiscriminator(
|
||||||
|
classByDiscriminatorValue,
|
||||||
|
getDiscriminatorValue(readElement, "className"));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
;
|
||||||
|
return fireBuilder.createGsonBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
|
||||||
|
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
|
||||||
|
if(null == element) {
|
||||||
|
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
|
||||||
|
}
|
||||||
|
return element.getAsString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
|
||||||
|
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase());
|
||||||
|
if(null == clazz) {
|
||||||
|
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
|
||||||
|
}
|
||||||
|
return clazz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON() {
|
||||||
|
gson = createGson()
|
||||||
|
.registerTypeAdapter(Date.class, dateTypeAdapter)
|
||||||
|
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
|
||||||
|
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
|
||||||
|
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
|
||||||
|
.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Gson.
|
||||||
|
*
|
||||||
|
* @return Gson
|
||||||
|
*/
|
||||||
|
public Gson getGson() {
|
||||||
|
return gson;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Gson.
|
||||||
|
*
|
||||||
|
* @param gson Gson
|
||||||
|
* @return JSON
|
||||||
|
*/
|
||||||
|
public JSON setGson(Gson gson) {
|
||||||
|
this.gson = gson;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON setLenientOnJson(boolean lenientOnJson) {
|
||||||
|
isLenientOnJson = lenientOnJson;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize the given Java object into JSON string.
|
||||||
|
*
|
||||||
|
* @param obj Object
|
||||||
|
* @return String representation of the JSON
|
||||||
|
*/
|
||||||
|
public String serialize(Object obj) {
|
||||||
|
return gson.toJson(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserialize the given JSON string to Java object.
|
||||||
|
*
|
||||||
|
* @param <T> Type
|
||||||
|
* @param body The JSON string
|
||||||
|
* @param returnType The type to deserialize into
|
||||||
|
* @return The deserialized Java object
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public <T> T deserialize(String body, Type returnType) {
|
||||||
|
try {
|
||||||
|
if (isLenientOnJson) {
|
||||||
|
JsonReader jsonReader = new JsonReader(new StringReader(body));
|
||||||
|
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
|
||||||
|
jsonReader.setLenient(true);
|
||||||
|
return gson.fromJson(jsonReader, returnType);
|
||||||
|
} else {
|
||||||
|
return gson.fromJson(body, returnType);
|
||||||
|
}
|
||||||
|
} catch (JsonParseException e) {
|
||||||
|
// Fallback processing when failed to parse JSON form response body:
|
||||||
|
// return the response body string directly for the String return type;
|
||||||
|
if (returnType.equals(String.class))
|
||||||
|
return (T) body;
|
||||||
|
else throw (e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gson TypeAdapter for JSR310 OffsetDateTime type
|
||||||
|
*/
|
||||||
|
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
|
||||||
|
|
||||||
|
private DateTimeFormatter formatter;
|
||||||
|
|
||||||
|
public OffsetDateTimeTypeAdapter() {
|
||||||
|
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
|
||||||
|
this.formatter = formatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(DateTimeFormatter dateFormat) {
|
||||||
|
this.formatter = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
|
||||||
|
if (date == null) {
|
||||||
|
out.nullValue();
|
||||||
|
} else {
|
||||||
|
out.value(formatter.format(date));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OffsetDateTime read(JsonReader in) throws IOException {
|
||||||
|
switch (in.peek()) {
|
||||||
|
case NULL:
|
||||||
|
in.nextNull();
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
String date = in.nextString();
|
||||||
|
if (date.endsWith("+0000")) {
|
||||||
|
date = date.substring(0, date.length()-5) + "Z";
|
||||||
|
}
|
||||||
|
return OffsetDateTime.parse(date, formatter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gson TypeAdapter for JSR310 LocalDate type
|
||||||
|
*/
|
||||||
|
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||||
|
|
||||||
|
private DateTimeFormatter formatter;
|
||||||
|
|
||||||
|
public LocalDateTypeAdapter() {
|
||||||
|
this(DateTimeFormatter.ISO_LOCAL_DATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
|
||||||
|
this.formatter = formatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(DateTimeFormatter dateFormat) {
|
||||||
|
this.formatter = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(JsonWriter out, LocalDate date) throws IOException {
|
||||||
|
if (date == null) {
|
||||||
|
out.nullValue();
|
||||||
|
} else {
|
||||||
|
out.value(formatter.format(date));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalDate read(JsonReader in) throws IOException {
|
||||||
|
switch (in.peek()) {
|
||||||
|
case NULL:
|
||||||
|
in.nextNull();
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
String date = in.nextString();
|
||||||
|
return LocalDate.parse(date, formatter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||||
|
offsetDateTimeTypeAdapter.setFormat(dateFormat);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||||
|
localDateTypeAdapter.setFormat(dateFormat);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gson TypeAdapter for java.sql.Date type
|
||||||
|
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
|
||||||
|
* (more efficient than SimpleDateFormat).
|
||||||
|
*/
|
||||||
|
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
|
||||||
|
|
||||||
|
private DateFormat dateFormat;
|
||||||
|
|
||||||
|
public SqlDateTypeAdapter() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SqlDateTypeAdapter(DateFormat dateFormat) {
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(DateFormat dateFormat) {
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(JsonWriter out, java.sql.Date date) throws IOException {
|
||||||
|
if (date == null) {
|
||||||
|
out.nullValue();
|
||||||
|
} else {
|
||||||
|
String value;
|
||||||
|
if (dateFormat != null) {
|
||||||
|
value = dateFormat.format(date);
|
||||||
|
} else {
|
||||||
|
value = date.toString();
|
||||||
|
}
|
||||||
|
out.value(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public java.sql.Date read(JsonReader in) throws IOException {
|
||||||
|
switch (in.peek()) {
|
||||||
|
case NULL:
|
||||||
|
in.nextNull();
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
String date = in.nextString();
|
||||||
|
try {
|
||||||
|
if (dateFormat != null) {
|
||||||
|
return new java.sql.Date(dateFormat.parse(date).getTime());
|
||||||
|
}
|
||||||
|
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new JsonParseException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gson TypeAdapter for java.util.Date type
|
||||||
|
* If the dateFormat is null, ISO8601Utils will be used.
|
||||||
|
*/
|
||||||
|
public static class DateTypeAdapter extends TypeAdapter<Date> {
|
||||||
|
|
||||||
|
private DateFormat dateFormat;
|
||||||
|
|
||||||
|
public DateTypeAdapter() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTypeAdapter(DateFormat dateFormat) {
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(DateFormat dateFormat) {
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(JsonWriter out, Date date) throws IOException {
|
||||||
|
if (date == null) {
|
||||||
|
out.nullValue();
|
||||||
|
} else {
|
||||||
|
String value;
|
||||||
|
if (dateFormat != null) {
|
||||||
|
value = dateFormat.format(date);
|
||||||
|
} else {
|
||||||
|
value = ISO8601Utils.format(date, true);
|
||||||
|
}
|
||||||
|
out.value(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date read(JsonReader in) throws IOException {
|
||||||
|
try {
|
||||||
|
switch (in.peek()) {
|
||||||
|
case NULL:
|
||||||
|
in.nextNull();
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
String date = in.nextString();
|
||||||
|
try {
|
||||||
|
if (dateFormat != null) {
|
||||||
|
return dateFormat.parse(date);
|
||||||
|
}
|
||||||
|
return ISO8601Utils.parse(date, new ParsePosition(0));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new JsonParseException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
throw new JsonParseException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON setDateFormat(DateFormat dateFormat) {
|
||||||
|
dateTypeAdapter.setFormat(dateFormat);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSON setSqlDateFormat(DateFormat dateFormat) {
|
||||||
|
sqlDateTypeAdapter.setFormat(dateFormat);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client;
|
||||||
|
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
import io.restassured.specification.ResponseSpecification;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class ResponseSpecBuilders {
|
||||||
|
|
||||||
|
private ResponseSpecBuilders() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Function<Response, Response> validatedWith(ResponseSpecification respSpec) {
|
||||||
|
return response -> response.then().spec(respSpec).extract().response();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Function<Response, Response> validatedWith(ResponseSpecBuilder respSpec) {
|
||||||
|
return validatedWith(respSpec.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param code expected status code
|
||||||
|
* @return ResponseSpecBuilder
|
||||||
|
*/
|
||||||
|
public static ResponseSpecBuilder shouldBeCode(int code) {
|
||||||
|
return new ResponseSpecBuilder().expectStatusCode(code);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class AnotherFakeApi {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private AnotherFakeApi(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AnotherFakeApi anotherFake(RequestSpecBuilder reqSpec) {
|
||||||
|
return new AnotherFakeApi(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public TestSpecialTagsOper testSpecialTags() {
|
||||||
|
return new TestSpecialTagsOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return AnotherFakeApi
|
||||||
|
*/
|
||||||
|
public AnotherFakeApi setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test special tags
|
||||||
|
* To test special tags
|
||||||
|
*
|
||||||
|
* @see #body client model (required)
|
||||||
|
* return Client
|
||||||
|
*/
|
||||||
|
public class TestSpecialTagsOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/another-fake/dummy";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestSpecialTagsOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestSpecialTagsOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /another-fake/dummy
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /another-fake/dummy
|
||||||
|
* @return Client
|
||||||
|
*/
|
||||||
|
public Client executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Client>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Client) client model (required)
|
||||||
|
*/
|
||||||
|
public TestSpecialTagsOper body(Client body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestSpecialTagsOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestSpecialTagsOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,883 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
import org.threeten.bp.LocalDate;
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import io.swagger.client.model.OuterComposite;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class FakeApi {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private FakeApi(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FakeApi fake(RequestSpecBuilder reqSpec) {
|
||||||
|
return new FakeApi(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public FakeOuterBooleanSerializeOper fakeOuterBooleanSerialize() {
|
||||||
|
return new FakeOuterBooleanSerializeOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterCompositeSerializeOper fakeOuterCompositeSerialize() {
|
||||||
|
return new FakeOuterCompositeSerializeOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterNumberSerializeOper fakeOuterNumberSerialize() {
|
||||||
|
return new FakeOuterNumberSerializeOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterStringSerializeOper fakeOuterStringSerialize() {
|
||||||
|
return new FakeOuterStringSerializeOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestClientModelOper testClientModel() {
|
||||||
|
return new TestClientModelOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestEndpointParametersOper testEndpointParameters() {
|
||||||
|
return new TestEndpointParametersOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestEnumParametersOper testEnumParameters() {
|
||||||
|
return new TestEnumParametersOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestInlineAdditionalPropertiesOper testInlineAdditionalProperties() {
|
||||||
|
return new TestInlineAdditionalPropertiesOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestJsonFormDataOper testJsonFormData() {
|
||||||
|
return new TestJsonFormDataOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return FakeApi
|
||||||
|
*/
|
||||||
|
public FakeApi setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer boolean types
|
||||||
|
*
|
||||||
|
* @see #body Input boolean as post body (optional)
|
||||||
|
* return Boolean
|
||||||
|
*/
|
||||||
|
public class FakeOuterBooleanSerializeOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/outer/boolean";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FakeOuterBooleanSerializeOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterBooleanSerializeOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/boolean
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/boolean
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
public Boolean executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Boolean>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Boolean) Input boolean as post body (optional)
|
||||||
|
*/
|
||||||
|
public FakeOuterBooleanSerializeOper body(Boolean body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FakeOuterBooleanSerializeOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FakeOuterBooleanSerializeOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of object with outer number type
|
||||||
|
*
|
||||||
|
* @see #body Input composite as post body (optional)
|
||||||
|
* return OuterComposite
|
||||||
|
*/
|
||||||
|
public class FakeOuterCompositeSerializeOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/outer/composite";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FakeOuterCompositeSerializeOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterCompositeSerializeOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/composite
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/composite
|
||||||
|
* @return OuterComposite
|
||||||
|
*/
|
||||||
|
public OuterComposite executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<OuterComposite>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (OuterComposite) Input composite as post body (optional)
|
||||||
|
*/
|
||||||
|
public FakeOuterCompositeSerializeOper body(OuterComposite body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FakeOuterCompositeSerializeOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FakeOuterCompositeSerializeOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer number types
|
||||||
|
*
|
||||||
|
* @see #body Input number as post body (optional)
|
||||||
|
* return BigDecimal
|
||||||
|
*/
|
||||||
|
public class FakeOuterNumberSerializeOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/outer/number";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FakeOuterNumberSerializeOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterNumberSerializeOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/number
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/number
|
||||||
|
* @return BigDecimal
|
||||||
|
*/
|
||||||
|
public BigDecimal executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<BigDecimal>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (BigDecimal) Input number as post body (optional)
|
||||||
|
*/
|
||||||
|
public FakeOuterNumberSerializeOper body(BigDecimal body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FakeOuterNumberSerializeOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FakeOuterNumberSerializeOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Test serialization of outer string types
|
||||||
|
*
|
||||||
|
* @see #body Input string as post body (optional)
|
||||||
|
* return String
|
||||||
|
*/
|
||||||
|
public class FakeOuterStringSerializeOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/outer/string";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FakeOuterStringSerializeOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FakeOuterStringSerializeOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/string
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/outer/string
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<String>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (String) Input string as post body (optional)
|
||||||
|
*/
|
||||||
|
public FakeOuterStringSerializeOper body(String body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FakeOuterStringSerializeOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FakeOuterStringSerializeOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* To test \"client\" model
|
||||||
|
* To test \"client\" model
|
||||||
|
*
|
||||||
|
* @see #body client model (required)
|
||||||
|
* return Client
|
||||||
|
*/
|
||||||
|
public class TestClientModelOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestClientModelOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestClientModelOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /fake
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /fake
|
||||||
|
* @return Client
|
||||||
|
*/
|
||||||
|
public Client executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Client>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Client) client model (required)
|
||||||
|
*/
|
||||||
|
public TestClientModelOper body(Client body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestClientModelOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestClientModelOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
*
|
||||||
|
* @see #numberForm None (required)
|
||||||
|
* @see #_doubleForm None (required)
|
||||||
|
* @see #patternWithoutDelimiterForm None (required)
|
||||||
|
* @see #_byteForm None (required)
|
||||||
|
* @see #integerForm None (optional)
|
||||||
|
* @see #int32Form None (optional)
|
||||||
|
* @see #int64Form None (optional)
|
||||||
|
* @see #_floatForm None (optional)
|
||||||
|
* @see #stringForm None (optional)
|
||||||
|
* @see #binaryForm None (optional)
|
||||||
|
* @see #dateForm None (optional)
|
||||||
|
* @see #dateTimeForm None (optional)
|
||||||
|
* @see #passwordForm None (optional)
|
||||||
|
* @see #paramCallbackForm None (optional)
|
||||||
|
*/
|
||||||
|
public class TestEndpointParametersOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestEndpointParametersOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/xml; charset=utf-8");
|
||||||
|
reqSpec.setAccept("application/xml; charset=utf-8,application/json; charset=utf-8");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestEndpointParametersOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/xml; charset=utf-8");
|
||||||
|
reqSpec.setAccept("application/xml; charset=utf-8,application/json; charset=utf-8");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer (Integer) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper integerForm(Object... integer) {
|
||||||
|
reqSpec.addFormParam("integer", integer);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int32 (Integer) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper int32Form(Object... int32) {
|
||||||
|
reqSpec.addFormParam("int32", int32);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int64 (Long) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper int64Form(Object... int64) {
|
||||||
|
reqSpec.addFormParam("int64", int64);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param number (BigDecimal) None (required)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper numberForm(Object... number) {
|
||||||
|
reqSpec.addFormParam("number", number);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param _float (Float) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper _floatForm(Object... _float) {
|
||||||
|
reqSpec.addFormParam("float", _float);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param _double (Double) None (required)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper _doubleForm(Object... _double) {
|
||||||
|
reqSpec.addFormParam("double", _double);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string (String) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper stringForm(Object... string) {
|
||||||
|
reqSpec.addFormParam("string", string);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param patternWithoutDelimiter (String) None (required)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper patternWithoutDelimiterForm(Object... patternWithoutDelimiter) {
|
||||||
|
reqSpec.addFormParam("pattern_without_delimiter", patternWithoutDelimiter);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param _byte (byte[]) None (required)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper _byteForm(Object... _byte) {
|
||||||
|
reqSpec.addFormParam("byte", _byte);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param binary (byte[]) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper binaryForm(Object... binary) {
|
||||||
|
reqSpec.addFormParam("binary", binary);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param date (LocalDate) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper dateForm(Object... date) {
|
||||||
|
reqSpec.addFormParam("date", date);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dateTime (OffsetDateTime) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper dateTimeForm(Object... dateTime) {
|
||||||
|
reqSpec.addFormParam("dateTime", dateTime);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param password (String) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper passwordForm(Object... password) {
|
||||||
|
reqSpec.addFormParam("password", password);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param paramCallback (String) None (optional)
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper paramCallbackForm(Object... paramCallback) {
|
||||||
|
reqSpec.addFormParam("callback", paramCallback);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestEndpointParametersOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* To test enum parameters
|
||||||
|
* To test enum parameters
|
||||||
|
*
|
||||||
|
* @see #enumFormStringArrayForm Form parameter enum test (string array) (optional)
|
||||||
|
* @see #enumFormStringForm Form parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @see #enumHeaderStringArrayHeader Header parameter enum test (string array) (optional)
|
||||||
|
* @see #enumHeaderStringHeader Header parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @see #enumQueryStringArrayQuery Query parameter enum test (string array) (optional)
|
||||||
|
* @see #enumQueryStringQuery Query parameter enum test (string) (optional, default to -efg)
|
||||||
|
* @see #enumQueryIntegerQuery Query parameter enum test (double) (optional)
|
||||||
|
* @see #enumQueryDoubleForm Query parameter enum test (double) (optional)
|
||||||
|
*/
|
||||||
|
public class TestEnumParametersOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestEnumParametersOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("*/*");
|
||||||
|
reqSpec.setAccept("*/*");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestEnumParametersOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("*/*");
|
||||||
|
reqSpec.setAccept("*/*");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /fake
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumHeaderStringArray (List<String>) Header parameter enum test (string array) (optional)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumHeaderStringArrayHeader(String enumHeaderStringArray) {
|
||||||
|
reqSpec.addHeader("enum_header_string_array", enumHeaderStringArray);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumHeaderString (String) Header parameter enum test (string) (optional, default to -efg)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumHeaderStringHeader(String enumHeaderString) {
|
||||||
|
reqSpec.addHeader("enum_header_string", enumHeaderString);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumQueryStringArray (List<String>) Query parameter enum test (string array) (optional)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumQueryStringArrayQuery(Object... enumQueryStringArray) {
|
||||||
|
reqSpec.addQueryParam("enum_query_string_array", enumQueryStringArray);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumQueryString (String) Query parameter enum test (string) (optional, default to -efg)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumQueryStringQuery(Object... enumQueryString) {
|
||||||
|
reqSpec.addQueryParam("enum_query_string", enumQueryString);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumQueryInteger (Integer) Query parameter enum test (double) (optional)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumQueryIntegerQuery(Object... enumQueryInteger) {
|
||||||
|
reqSpec.addQueryParam("enum_query_integer", enumQueryInteger);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumFormStringArray (List<String>) Form parameter enum test (string array) (optional)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumFormStringArrayForm(Object... enumFormStringArray) {
|
||||||
|
reqSpec.addFormParam("enum_form_string_array", enumFormStringArray);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumFormString (String) Form parameter enum test (string) (optional, default to -efg)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumFormStringForm(Object... enumFormString) {
|
||||||
|
reqSpec.addFormParam("enum_form_string", enumFormString);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param enumQueryDouble (Double) Query parameter enum test (double) (optional)
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper enumQueryDoubleForm(Object... enumQueryDouble) {
|
||||||
|
reqSpec.addFormParam("enum_query_double", enumQueryDouble);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestEnumParametersOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* test inline additionalProperties
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body request body (required)
|
||||||
|
*/
|
||||||
|
public class TestInlineAdditionalPropertiesOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/inline-additionalProperties";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestInlineAdditionalPropertiesOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestInlineAdditionalPropertiesOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /fake/inline-additionalProperties
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param param (Object) request body (required)
|
||||||
|
*/
|
||||||
|
public TestInlineAdditionalPropertiesOper body(Object param) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(param));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestInlineAdditionalPropertiesOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestInlineAdditionalPropertiesOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* test json serialization of form data
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #paramForm field1 (required)
|
||||||
|
* @see #param2Form field2 (required)
|
||||||
|
*/
|
||||||
|
public class TestJsonFormDataOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake/jsonFormData";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestJsonFormDataOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestJsonFormDataOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /fake/jsonFormData
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param param (String) field1 (required)
|
||||||
|
*/
|
||||||
|
public TestJsonFormDataOper paramForm(Object... param) {
|
||||||
|
reqSpec.addFormParam("param", param);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param param2 (String) field2 (required)
|
||||||
|
*/
|
||||||
|
public TestJsonFormDataOper param2Form(Object... param2) {
|
||||||
|
reqSpec.addFormParam("param2", param2);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestJsonFormDataOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestJsonFormDataOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class FakeClassnameTags123Api {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private FakeClassnameTags123Api(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FakeClassnameTags123Api fakeClassnameTags123(RequestSpecBuilder reqSpec) {
|
||||||
|
return new FakeClassnameTags123Api(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public TestClassnameOper testClassname() {
|
||||||
|
return new TestClassnameOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return FakeClassnameTags123Api
|
||||||
|
*/
|
||||||
|
public FakeClassnameTags123Api setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body client model (required)
|
||||||
|
* return Client
|
||||||
|
*/
|
||||||
|
public class TestClassnameOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/fake_classname_test";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public TestClassnameOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestClassnameOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /fake_classname_test
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PATCH, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PATCH /fake_classname_test
|
||||||
|
* @return Client
|
||||||
|
*/
|
||||||
|
public Client executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Client>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Client) client model (required)
|
||||||
|
*/
|
||||||
|
public TestClassnameOper body(Client body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public TestClassnameOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public TestClassnameOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,661 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import java.io.File;
|
||||||
|
import io.swagger.client.model.ModelApiResponse;
|
||||||
|
import io.swagger.client.model.Pet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class PetApi {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private PetApi(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PetApi pet(RequestSpecBuilder reqSpec) {
|
||||||
|
return new PetApi(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AddPetOper addPet() {
|
||||||
|
return new AddPetOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeletePetOper deletePet() {
|
||||||
|
return new DeletePetOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FindPetsByStatusOper findPetsByStatus() {
|
||||||
|
return new FindPetsByStatusOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public FindPetsByTagsOper findPetsByTags() {
|
||||||
|
return new FindPetsByTagsOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetPetByIdOper getPetById() {
|
||||||
|
return new GetPetByIdOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdatePetOper updatePet() {
|
||||||
|
return new UpdatePetOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdatePetWithFormOper updatePetWithForm() {
|
||||||
|
return new UpdatePetWithFormOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UploadFileOper uploadFile() {
|
||||||
|
return new UploadFileOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return PetApi
|
||||||
|
*/
|
||||||
|
public PetApi setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new pet to the store
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body Pet object that needs to be added to the store (required)
|
||||||
|
*/
|
||||||
|
public class AddPetOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public AddPetOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddPetOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /pet
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Pet) Pet object that needs to be added to the store (required)
|
||||||
|
*/
|
||||||
|
public AddPetOper body(Pet body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public AddPetOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public AddPetOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #petIdPath Pet id to delete (required)
|
||||||
|
* @see #apiKeyHeader (optional)
|
||||||
|
*/
|
||||||
|
public class DeletePetOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/{petId}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public DeletePetOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeletePetOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE /pet/{petId}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param apiKey (String) (optional)
|
||||||
|
*/
|
||||||
|
public DeletePetOper apiKeyHeader(String apiKey) {
|
||||||
|
reqSpec.addHeader("api_key", apiKey);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param petId (Long) Pet id to delete (required)
|
||||||
|
*/
|
||||||
|
public DeletePetOper petIdPath(Object petId) {
|
||||||
|
reqSpec.addPathParam("petId", petId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public DeletePetOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public DeletePetOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by status
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
*
|
||||||
|
* @see #statusQuery Status values that need to be considered for filter (required)
|
||||||
|
* return List<Pet>
|
||||||
|
*/
|
||||||
|
public class FindPetsByStatusOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/findByStatus";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FindPetsByStatusOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FindPetsByStatusOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/findByStatus
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/findByStatus
|
||||||
|
* @return List<Pet>
|
||||||
|
*/
|
||||||
|
public List<Pet> executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<List<Pet>>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param status (List<String>) Status values that need to be considered for filter (required)
|
||||||
|
*/
|
||||||
|
public FindPetsByStatusOper statusQuery(Object... status) {
|
||||||
|
reqSpec.addQueryParam("status", status);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FindPetsByStatusOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FindPetsByStatusOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds Pets by tags
|
||||||
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
*
|
||||||
|
* @see #tagsQuery Tags to filter by (required)
|
||||||
|
* return List<Pet>
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public class FindPetsByTagsOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/findByTags";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public FindPetsByTagsOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FindPetsByTagsOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/findByTags
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/findByTags
|
||||||
|
* @return List<Pet>
|
||||||
|
*/
|
||||||
|
public List<Pet> executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<List<Pet>>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tags (List<String>) Tags to filter by (required)
|
||||||
|
*/
|
||||||
|
public FindPetsByTagsOper tagsQuery(Object... tags) {
|
||||||
|
reqSpec.addQueryParam("tags", tags);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public FindPetsByTagsOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public FindPetsByTagsOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Find pet by ID
|
||||||
|
* Returns a single pet
|
||||||
|
*
|
||||||
|
* @see #petIdPath ID of pet to return (required)
|
||||||
|
* return Pet
|
||||||
|
*/
|
||||||
|
public class GetPetByIdOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/{petId}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public GetPetByIdOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetPetByIdOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/{petId}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /pet/{petId}
|
||||||
|
* @return Pet
|
||||||
|
*/
|
||||||
|
public Pet executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Pet>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param petId (Long) ID of pet to return (required)
|
||||||
|
*/
|
||||||
|
public GetPetByIdOper petIdPath(Object petId) {
|
||||||
|
reqSpec.addPathParam("petId", petId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public GetPetByIdOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public GetPetByIdOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body Pet object that needs to be added to the store (required)
|
||||||
|
*/
|
||||||
|
public class UpdatePetOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public UpdatePetOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdatePetOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUT /pet
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Pet) Pet object that needs to be added to the store (required)
|
||||||
|
*/
|
||||||
|
public UpdatePetOper body(Pet body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public UpdatePetOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public UpdatePetOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #petIdPath ID of pet that needs to be updated (required)
|
||||||
|
* @see #nameForm Updated name of the pet (optional)
|
||||||
|
* @see #statusForm Updated status of the pet (optional)
|
||||||
|
*/
|
||||||
|
public class UpdatePetWithFormOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/{petId}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public UpdatePetWithFormOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/x-www-form-urlencoded");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdatePetWithFormOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/x-www-form-urlencoded");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /pet/{petId}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param petId (Long) ID of pet that needs to be updated (required)
|
||||||
|
*/
|
||||||
|
public UpdatePetWithFormOper petIdPath(Object petId) {
|
||||||
|
reqSpec.addPathParam("petId", petId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name (String) Updated name of the pet (optional)
|
||||||
|
*/
|
||||||
|
public UpdatePetWithFormOper nameForm(Object... name) {
|
||||||
|
reqSpec.addFormParam("name", name);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param status (String) Updated status of the pet (optional)
|
||||||
|
*/
|
||||||
|
public UpdatePetWithFormOper statusForm(Object... status) {
|
||||||
|
reqSpec.addFormParam("status", status);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public UpdatePetWithFormOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public UpdatePetWithFormOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* uploads an image
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #petIdPath ID of pet to update (required)
|
||||||
|
* @see #additionalMetadataForm Additional data to pass to server (optional)
|
||||||
|
* @see #fileMultiPart file to upload (optional)
|
||||||
|
* return ModelApiResponse
|
||||||
|
*/
|
||||||
|
public class UploadFileOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/pet/{petId}/uploadImage";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public UploadFileOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("multipart/form-data");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UploadFileOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("multipart/form-data");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /pet/{petId}/uploadImage
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /pet/{petId}/uploadImage
|
||||||
|
* @return ModelApiResponse
|
||||||
|
*/
|
||||||
|
public ModelApiResponse executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<ModelApiResponse>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param petId (Long) ID of pet to update (required)
|
||||||
|
*/
|
||||||
|
public UploadFileOper petIdPath(Object petId) {
|
||||||
|
reqSpec.addPathParam("petId", petId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param additionalMetadata (String) Additional data to pass to server (optional)
|
||||||
|
*/
|
||||||
|
public UploadFileOper additionalMetadataForm(Object... additionalMetadata) {
|
||||||
|
reqSpec.addFormParam("additionalMetadata", additionalMetadata);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It will assume that the control name is file and the <content-type> is <application/octet-stream>
|
||||||
|
* @see #reqSpec for customise
|
||||||
|
* @param file(File) file to upload (optional)
|
||||||
|
*/
|
||||||
|
public UploadFileOper fileMultiPart(File file) {
|
||||||
|
reqSpec.addMultiPart(file);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public UploadFileOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public UploadFileOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,340 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import io.swagger.client.model.Order;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class StoreApi {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private StoreApi(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StoreApi store(RequestSpecBuilder reqSpec) {
|
||||||
|
return new StoreApi(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DeleteOrderOper deleteOrder() {
|
||||||
|
return new DeleteOrderOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetInventoryOper getInventory() {
|
||||||
|
return new GetInventoryOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetOrderByIdOper getOrderById() {
|
||||||
|
return new GetOrderByIdOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlaceOrderOper placeOrder() {
|
||||||
|
return new PlaceOrderOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return StoreApi
|
||||||
|
*/
|
||||||
|
public StoreApi setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete purchase order by ID
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
*
|
||||||
|
* @see #orderIdPath ID of the order that needs to be deleted (required)
|
||||||
|
*/
|
||||||
|
public class DeleteOrderOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/store/order/{order_id}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public DeleteOrderOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteOrderOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE /store/order/{order_id}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param orderId (String) ID of the order that needs to be deleted (required)
|
||||||
|
*/
|
||||||
|
public DeleteOrderOper orderIdPath(Object orderId) {
|
||||||
|
reqSpec.addPathParam("order_id", orderId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public DeleteOrderOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public DeleteOrderOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
*
|
||||||
|
* return Map<String, Integer>
|
||||||
|
*/
|
||||||
|
public class GetInventoryOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/store/inventory";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public GetInventoryOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetInventoryOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /store/inventory
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /store/inventory
|
||||||
|
* @return Map<String, Integer>
|
||||||
|
*/
|
||||||
|
public Map<String, Integer> executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public GetInventoryOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public GetInventoryOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Find purchase order by ID
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
*
|
||||||
|
* @see #orderIdPath ID of pet that needs to be fetched (required)
|
||||||
|
* return Order
|
||||||
|
*/
|
||||||
|
public class GetOrderByIdOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/store/order/{order_id}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public GetOrderByIdOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetOrderByIdOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /store/order/{order_id}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /store/order/{order_id}
|
||||||
|
* @return Order
|
||||||
|
*/
|
||||||
|
public Order executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Order>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param orderId (Long) ID of pet that needs to be fetched (required)
|
||||||
|
*/
|
||||||
|
public GetOrderByIdOper orderIdPath(Object orderId) {
|
||||||
|
reqSpec.addPathParam("order_id", orderId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public GetOrderByIdOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public GetOrderByIdOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Place an order for a pet
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body order placed for purchasing the pet (required)
|
||||||
|
* return Order
|
||||||
|
*/
|
||||||
|
public class PlaceOrderOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/store/order";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public PlaceOrderOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlaceOrderOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /store/order
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /store/order
|
||||||
|
* @return Order
|
||||||
|
*/
|
||||||
|
public Order executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<Order>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (Order) order placed for purchasing the pet (required)
|
||||||
|
*/
|
||||||
|
public PlaceOrderOper body(Order body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public PlaceOrderOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public PlaceOrderOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,598 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import io.swagger.client.model.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import io.restassured.response.Response;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import io.swagger.client.JSON;
|
||||||
|
|
||||||
|
import static io.restassured.http.Method.*;
|
||||||
|
|
||||||
|
public class UserApi {
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private JSON json;
|
||||||
|
|
||||||
|
private UserApi(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
this.json = new JSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserApi user(RequestSpecBuilder reqSpec) {
|
||||||
|
return new UserApi(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CreateUserOper createUser() {
|
||||||
|
return new CreateUserOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUsersWithArrayInputOper createUsersWithArrayInput() {
|
||||||
|
return new CreateUsersWithArrayInputOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUsersWithListInputOper createUsersWithListInput() {
|
||||||
|
return new CreateUsersWithListInputOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteUserOper deleteUser() {
|
||||||
|
return new DeleteUserOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetUserByNameOper getUserByName() {
|
||||||
|
return new GetUserByNameOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginUserOper loginUser() {
|
||||||
|
return new LoginUserOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LogoutUserOper logoutUser() {
|
||||||
|
return new LogoutUserOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateUserOper updateUser() {
|
||||||
|
return new UpdateUserOper(reqSpec);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get JSON
|
||||||
|
*
|
||||||
|
* @return JSON object
|
||||||
|
*/
|
||||||
|
public JSON getJSON() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set JSON
|
||||||
|
*
|
||||||
|
* @param json JSON object
|
||||||
|
* @return UserApi
|
||||||
|
*/
|
||||||
|
public UserApi setJSON(JSON json) {
|
||||||
|
this.json = json;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
*
|
||||||
|
* @see #body Created user object (required)
|
||||||
|
*/
|
||||||
|
public class CreateUserOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public CreateUserOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUserOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /user
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (User) Created user object (required)
|
||||||
|
*/
|
||||||
|
public CreateUserOper body(User body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public CreateUserOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public CreateUserOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body List of user object (required)
|
||||||
|
*/
|
||||||
|
public class CreateUsersWithArrayInputOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/createWithArray";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public CreateUsersWithArrayInputOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUsersWithArrayInputOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /user/createWithArray
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (List<User>) List of user object (required)
|
||||||
|
*/
|
||||||
|
public CreateUsersWithArrayInputOper body(List<User> body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public CreateUsersWithArrayInputOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public CreateUsersWithArrayInputOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #body List of user object (required)
|
||||||
|
*/
|
||||||
|
public class CreateUsersWithListInputOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/createWithList";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public CreateUsersWithListInputOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUsersWithListInputOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /user/createWithList
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(POST, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (List<User>) List of user object (required)
|
||||||
|
*/
|
||||||
|
public CreateUsersWithListInputOper body(List<User> body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public CreateUsersWithListInputOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public CreateUsersWithListInputOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
*
|
||||||
|
* @see #usernamePath The name that needs to be deleted (required)
|
||||||
|
*/
|
||||||
|
public class DeleteUserOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/{username}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public DeleteUserOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteUserOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE /user/{username}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(DELETE, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param username (String) The name that needs to be deleted (required)
|
||||||
|
*/
|
||||||
|
public DeleteUserOper usernamePath(Object username) {
|
||||||
|
reqSpec.addPathParam("username", username);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public DeleteUserOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public DeleteUserOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #usernamePath The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
* return User
|
||||||
|
*/
|
||||||
|
public class GetUserByNameOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/{username}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public GetUserByNameOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetUserByNameOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /user/{username}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /user/{username}
|
||||||
|
* @return User
|
||||||
|
*/
|
||||||
|
public User executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<User>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param username (String) The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
*/
|
||||||
|
public GetUserByNameOper usernamePath(Object username) {
|
||||||
|
reqSpec.addPathParam("username", username);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public GetUserByNameOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public GetUserByNameOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @see #usernameQuery The user name for login (required)
|
||||||
|
* @see #passwordQuery The password for login in clear text (required)
|
||||||
|
* return String
|
||||||
|
*/
|
||||||
|
public class LoginUserOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/login";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public LoginUserOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginUserOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /user/login
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /user/login
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String executeAs(Function<Response, Response> handler) {
|
||||||
|
Type type = new TypeToken<String>(){}.getType();
|
||||||
|
return getJSON().deserialize(execute(handler).asString(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param username (String) The user name for login (required)
|
||||||
|
*/
|
||||||
|
public LoginUserOper usernameQuery(Object... username) {
|
||||||
|
reqSpec.addQueryParam("username", username);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param password (String) The password for login in clear text (required)
|
||||||
|
*/
|
||||||
|
public LoginUserOper passwordQuery(Object... password) {
|
||||||
|
reqSpec.addQueryParam("password", password);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public LoginUserOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public LoginUserOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class LogoutUserOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/logout";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public LogoutUserOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LogoutUserOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /user/logout
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(GET, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public LogoutUserOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public LogoutUserOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Updated user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
*
|
||||||
|
* @see #usernamePath name that need to be deleted (required)
|
||||||
|
* @see #body Updated user object (required)
|
||||||
|
*/
|
||||||
|
public class UpdateUserOper {
|
||||||
|
|
||||||
|
public static final String REQ_URI = "/user/{username}";
|
||||||
|
|
||||||
|
private RequestSpecBuilder reqSpec;
|
||||||
|
|
||||||
|
private ResponseSpecBuilder respSpec;
|
||||||
|
|
||||||
|
public UpdateUserOper() {
|
||||||
|
this.reqSpec = new RequestSpecBuilder();
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateUserOper(RequestSpecBuilder reqSpec) {
|
||||||
|
this.reqSpec = reqSpec;
|
||||||
|
reqSpec.setContentType("application/json");
|
||||||
|
reqSpec.setAccept("application/json");
|
||||||
|
this.respSpec = new ResponseSpecBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUT /user/{username}
|
||||||
|
*/
|
||||||
|
public <T> T execute(Function<Response, T> handler) {
|
||||||
|
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param body (User) Updated user object (required)
|
||||||
|
*/
|
||||||
|
public UpdateUserOper body(User body) {
|
||||||
|
reqSpec.setBody(getJSON().serialize(body));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param username (String) name that need to be deleted (required)
|
||||||
|
*/
|
||||||
|
public UpdateUserOper usernamePath(Object username) {
|
||||||
|
reqSpec.addPathParam("username", username);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise request specification
|
||||||
|
*/
|
||||||
|
public UpdateUserOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||||
|
consumer.accept(reqSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customise response specification
|
||||||
|
*/
|
||||||
|
public UpdateUserOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||||
|
consumer.accept(respSpec);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AdditionalPropertiesClass {
|
||||||
|
@SerializedName("map_property")
|
||||||
|
private Map<String, String> mapProperty = null;
|
||||||
|
|
||||||
|
@SerializedName("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<String, String>();
|
||||||
|
}
|
||||||
|
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<String, Map<String, String>>();
|
||||||
|
}
|
||||||
|
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get mapOfMapProperty
|
||||||
|
* @return mapOfMapProperty
|
||||||
|
**/
|
||||||
|
@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,121 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animal
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public class Animal {
|
||||||
|
@SerializedName("className")
|
||||||
|
private String className = null;
|
||||||
|
|
||||||
|
@SerializedName("color")
|
||||||
|
private String color = "red";
|
||||||
|
|
||||||
|
public Animal() {
|
||||||
|
this.className = this.getClass().getSimpleName();
|
||||||
|
}
|
||||||
|
public Animal className(String className) {
|
||||||
|
this.className = className;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get className
|
||||||
|
* @return className
|
||||||
|
**/
|
||||||
|
@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,66 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import io.swagger.client.model.Animal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayOfArrayOfNumberOnly {
|
||||||
|
@SerializedName("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<List<BigDecimal>>();
|
||||||
|
}
|
||||||
|
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayNumber
|
||||||
|
* @return arrayArrayNumber
|
||||||
|
**/
|
||||||
|
@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 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayOfNumberOnly {
|
||||||
|
@SerializedName("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<BigDecimal>();
|
||||||
|
}
|
||||||
|
this.arrayNumber.add(arrayNumberItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayNumber
|
||||||
|
* @return arrayNumber
|
||||||
|
**/
|
||||||
|
@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,167 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.client.model.ReadOnlyFirst;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ArrayTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ArrayTest {
|
||||||
|
@SerializedName("array_of_string")
|
||||||
|
private List<String> arrayOfString = null;
|
||||||
|
|
||||||
|
@SerializedName("array_array_of_integer")
|
||||||
|
private List<List<Long>> arrayArrayOfInteger = null;
|
||||||
|
|
||||||
|
@SerializedName("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<String>();
|
||||||
|
}
|
||||||
|
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<List<Long>>();
|
||||||
|
}
|
||||||
|
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayOfInteger
|
||||||
|
* @return arrayArrayOfInteger
|
||||||
|
**/
|
||||||
|
@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<List<ReadOnlyFirst>>();
|
||||||
|
}
|
||||||
|
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayArrayOfModel
|
||||||
|
* @return arrayArrayOfModel
|
||||||
|
**/
|
||||||
|
@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,209 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Capitalization
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Capitalization {
|
||||||
|
@SerializedName("smallCamel")
|
||||||
|
private String smallCamel = null;
|
||||||
|
|
||||||
|
@SerializedName("CapitalCamel")
|
||||||
|
private String capitalCamel = null;
|
||||||
|
|
||||||
|
@SerializedName("small_Snake")
|
||||||
|
private String smallSnake = null;
|
||||||
|
|
||||||
|
@SerializedName("Capital_Snake")
|
||||||
|
private String capitalSnake = null;
|
||||||
|
|
||||||
|
@SerializedName("SCA_ETH_Flow_Points")
|
||||||
|
private String scAETHFlowPoints = null;
|
||||||
|
|
||||||
|
@SerializedName("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,96 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.client.model.Animal;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cat
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Cat extends Animal {
|
||||||
|
@SerializedName("declawed")
|
||||||
|
private Boolean declawed = null;
|
||||||
|
|
||||||
|
public Cat declawed(Boolean declawed) {
|
||||||
|
this.declawed = declawed;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get declawed
|
||||||
|
* @return declawed
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Boolean isDeclawed() {
|
||||||
|
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,117 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Category {
|
||||||
|
@SerializedName("id")
|
||||||
|
private Long id = null;
|
||||||
|
|
||||||
|
@SerializedName("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 ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for testing model with \"_class\" property
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "Model for testing model with \"_class\" property")
|
||||||
|
|
||||||
|
public class ClassModel {
|
||||||
|
@SerializedName("_class")
|
||||||
|
private String propertyClass = null;
|
||||||
|
|
||||||
|
public ClassModel propertyClass(String propertyClass) {
|
||||||
|
this.propertyClass = propertyClass;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get propertyClass
|
||||||
|
* @return propertyClass
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getPropertyClass() {
|
||||||
|
return propertyClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPropertyClass(String propertyClass) {
|
||||||
|
this.propertyClass = propertyClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ClassModel classModel = (ClassModel) o;
|
||||||
|
return Objects.equals(this.propertyClass, classModel.propertyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(propertyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ClassModel {\n");
|
||||||
|
|
||||||
|
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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,94 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Client
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Client {
|
||||||
|
@SerializedName("client")
|
||||||
|
private String client = null;
|
||||||
|
|
||||||
|
public Client client(String client) {
|
||||||
|
this.client = client;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get client
|
||||||
|
* @return client
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getClient() {
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClient(String client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Client client = (Client) o;
|
||||||
|
return Objects.equals(this.client, client.client);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Client {\n");
|
||||||
|
|
||||||
|
sb.append(" client: ").append(toIndentedString(client)).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,96 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.client.model.Animal;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dog
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Dog extends Animal {
|
||||||
|
@SerializedName("breed")
|
||||||
|
private String breed = null;
|
||||||
|
|
||||||
|
public Dog breed(String breed) {
|
||||||
|
this.breed = breed;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get breed
|
||||||
|
* @return breed
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getBreed() {
|
||||||
|
return breed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBreed(String breed) {
|
||||||
|
this.breed = breed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Dog dog = (Dog) o;
|
||||||
|
return Objects.equals(this.breed, dog.breed) &&
|
||||||
|
super.equals(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(breed, super.hashCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Dog {\n");
|
||||||
|
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||||
|
sb.append(" breed: ").append(toIndentedString(breed)).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,221 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EnumArrays
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EnumArrays {
|
||||||
|
/**
|
||||||
|
* Gets or Sets justSymbol
|
||||||
|
*/
|
||||||
|
@JsonAdapter(JustSymbolEnum.Adapter.class)
|
||||||
|
public enum JustSymbolEnum {
|
||||||
|
GREATER_THAN_OR_EQUAL_TO(">="),
|
||||||
|
|
||||||
|
DOLLAR("$");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
JustSymbolEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JustSymbolEnum fromValue(String text) {
|
||||||
|
for (JustSymbolEnum b : JustSymbolEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<JustSymbolEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JustSymbolEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
String value = jsonReader.nextString();
|
||||||
|
return JustSymbolEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("just_symbol")
|
||||||
|
private JustSymbolEnum justSymbol = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or Sets arrayEnum
|
||||||
|
*/
|
||||||
|
@JsonAdapter(ArrayEnumEnum.Adapter.class)
|
||||||
|
public enum ArrayEnumEnum {
|
||||||
|
FISH("fish"),
|
||||||
|
|
||||||
|
CRAB("crab");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
ArrayEnumEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayEnumEnum fromValue(String text) {
|
||||||
|
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<ArrayEnumEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
String value = jsonReader.nextString();
|
||||||
|
return ArrayEnumEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("array_enum")
|
||||||
|
private List<ArrayEnumEnum> arrayEnum = null;
|
||||||
|
|
||||||
|
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
|
||||||
|
this.justSymbol = justSymbol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get justSymbol
|
||||||
|
* @return justSymbol
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public JustSymbolEnum getJustSymbol() {
|
||||||
|
return justSymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJustSymbol(JustSymbolEnum justSymbol) {
|
||||||
|
this.justSymbol = justSymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||||
|
this.arrayEnum = arrayEnum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||||
|
if (this.arrayEnum == null) {
|
||||||
|
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||||
|
}
|
||||||
|
this.arrayEnum.add(arrayEnumItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get arrayEnum
|
||||||
|
* @return arrayEnum
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public List<ArrayEnumEnum> getArrayEnum() {
|
||||||
|
return arrayEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||||
|
this.arrayEnum = arrayEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EnumArrays enumArrays = (EnumArrays) o;
|
||||||
|
return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
|
||||||
|
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(justSymbol, arrayEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class EnumArrays {\n");
|
||||||
|
|
||||||
|
sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
|
||||||
|
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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,75 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.client.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import com.google.gson.TypeAdapter;
|
||||||
|
import com.google.gson.annotations.JsonAdapter;
|
||||||
|
import com.google.gson.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or Sets EnumClass
|
||||||
|
*/
|
||||||
|
@JsonAdapter(EnumClass.Adapter.class)
|
||||||
|
public enum EnumClass {
|
||||||
|
|
||||||
|
_ABC("_abc"),
|
||||||
|
|
||||||
|
_EFG("-efg"),
|
||||||
|
|
||||||
|
_XYZ_("(xyz)");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
EnumClass(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumClass fromValue(String text) {
|
||||||
|
for (EnumClass b : EnumClass.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<EnumClass> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumClass read(final JsonReader jsonReader) throws IOException {
|
||||||
|
String value = jsonReader.nextString();
|
||||||
|
return EnumClass.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,307 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.client.model.OuterEnum;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EnumTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class EnumTest {
|
||||||
|
/**
|
||||||
|
* Gets or Sets enumString
|
||||||
|
*/
|
||||||
|
@JsonAdapter(EnumStringEnum.Adapter.class)
|
||||||
|
public enum EnumStringEnum {
|
||||||
|
UPPER("UPPER"),
|
||||||
|
|
||||||
|
LOWER("lower"),
|
||||||
|
|
||||||
|
EMPTY("");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
EnumStringEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumStringEnum fromValue(String text) {
|
||||||
|
for (EnumStringEnum b : EnumStringEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<EnumStringEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumStringEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
String value = jsonReader.nextString();
|
||||||
|
return EnumStringEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("enum_string")
|
||||||
|
private EnumStringEnum enumString = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or Sets enumInteger
|
||||||
|
*/
|
||||||
|
@JsonAdapter(EnumIntegerEnum.Adapter.class)
|
||||||
|
public enum EnumIntegerEnum {
|
||||||
|
NUMBER_1(1),
|
||||||
|
|
||||||
|
NUMBER_MINUS_1(-1);
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
|
||||||
|
EnumIntegerEnum(Integer value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumIntegerEnum fromValue(String text) {
|
||||||
|
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<EnumIntegerEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
Integer value = jsonReader.nextInt();
|
||||||
|
return EnumIntegerEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("enum_integer")
|
||||||
|
private EnumIntegerEnum enumInteger = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or Sets enumNumber
|
||||||
|
*/
|
||||||
|
@JsonAdapter(EnumNumberEnum.Adapter.class)
|
||||||
|
public enum EnumNumberEnum {
|
||||||
|
NUMBER_1_DOT_1(1.1),
|
||||||
|
|
||||||
|
NUMBER_MINUS_1_DOT_2(-1.2);
|
||||||
|
|
||||||
|
private Double value;
|
||||||
|
|
||||||
|
EnumNumberEnum(Double value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumNumberEnum fromValue(String text) {
|
||||||
|
for (EnumNumberEnum b : EnumNumberEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<EnumNumberEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumNumberEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
Double value = jsonReader.nextDouble();
|
||||||
|
return EnumNumberEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("enum_number")
|
||||||
|
private EnumNumberEnum enumNumber = null;
|
||||||
|
|
||||||
|
@SerializedName("outerEnum")
|
||||||
|
private OuterEnum outerEnum = null;
|
||||||
|
|
||||||
|
public EnumTest enumString(EnumStringEnum enumString) {
|
||||||
|
this.enumString = enumString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get enumString
|
||||||
|
* @return enumString
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public EnumStringEnum getEnumString() {
|
||||||
|
return enumString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnumString(EnumStringEnum enumString) {
|
||||||
|
this.enumString = enumString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
|
||||||
|
this.enumInteger = enumInteger;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get enumInteger
|
||||||
|
* @return enumInteger
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public EnumIntegerEnum getEnumInteger() {
|
||||||
|
return enumInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnumInteger(EnumIntegerEnum enumInteger) {
|
||||||
|
this.enumInteger = enumInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
|
||||||
|
this.enumNumber = enumNumber;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get enumNumber
|
||||||
|
* @return enumNumber
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public EnumNumberEnum getEnumNumber() {
|
||||||
|
return enumNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnumNumber(EnumNumberEnum enumNumber) {
|
||||||
|
this.enumNumber = enumNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumTest outerEnum(OuterEnum outerEnum) {
|
||||||
|
this.outerEnum = outerEnum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get outerEnum
|
||||||
|
* @return outerEnum
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public OuterEnum getOuterEnum() {
|
||||||
|
return outerEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOuterEnum(OuterEnum outerEnum) {
|
||||||
|
this.outerEnum = outerEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EnumTest enumTest = (EnumTest) o;
|
||||||
|
return Objects.equals(this.enumString, enumTest.enumString) &&
|
||||||
|
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
|
||||||
|
Objects.equals(this.enumNumber, enumTest.enumNumber) &&
|
||||||
|
Objects.equals(this.outerEnum, enumTest.outerEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(enumString, enumInteger, enumNumber, outerEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class EnumTest {\n");
|
||||||
|
|
||||||
|
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
|
||||||
|
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
|
||||||
|
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
|
||||||
|
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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,384 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.threeten.bp.LocalDate;
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FormatTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class FormatTest {
|
||||||
|
@SerializedName("integer")
|
||||||
|
private Integer integer = null;
|
||||||
|
|
||||||
|
@SerializedName("int32")
|
||||||
|
private Integer int32 = null;
|
||||||
|
|
||||||
|
@SerializedName("int64")
|
||||||
|
private Long int64 = null;
|
||||||
|
|
||||||
|
@SerializedName("number")
|
||||||
|
private BigDecimal number = null;
|
||||||
|
|
||||||
|
@SerializedName("float")
|
||||||
|
private Float _float = null;
|
||||||
|
|
||||||
|
@SerializedName("double")
|
||||||
|
private Double _double = null;
|
||||||
|
|
||||||
|
@SerializedName("string")
|
||||||
|
private String string = null;
|
||||||
|
|
||||||
|
@SerializedName("byte")
|
||||||
|
private byte[] _byte = null;
|
||||||
|
|
||||||
|
@SerializedName("binary")
|
||||||
|
private byte[] binary = null;
|
||||||
|
|
||||||
|
@SerializedName("date")
|
||||||
|
private LocalDate date = null;
|
||||||
|
|
||||||
|
@SerializedName("dateTime")
|
||||||
|
private OffsetDateTime dateTime = null;
|
||||||
|
|
||||||
|
@SerializedName("uuid")
|
||||||
|
private UUID uuid = null;
|
||||||
|
|
||||||
|
@SerializedName("password")
|
||||||
|
private String password = null;
|
||||||
|
|
||||||
|
public FormatTest integer(Integer integer) {
|
||||||
|
this.integer = integer;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get integer
|
||||||
|
* minimum: 10
|
||||||
|
* maximum: 100
|
||||||
|
* @return integer
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getInteger() {
|
||||||
|
return integer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInteger(Integer integer) {
|
||||||
|
this.integer = integer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest int32(Integer int32) {
|
||||||
|
this.int32 = int32;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get int32
|
||||||
|
* minimum: 20
|
||||||
|
* maximum: 200
|
||||||
|
* @return int32
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getInt32() {
|
||||||
|
return int32;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInt32(Integer int32) {
|
||||||
|
this.int32 = int32;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest int64(Long int64) {
|
||||||
|
this.int64 = int64;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get int64
|
||||||
|
* @return int64
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Long getInt64() {
|
||||||
|
return int64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInt64(Long int64) {
|
||||||
|
this.int64 = int64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest number(BigDecimal number) {
|
||||||
|
this.number = number;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number
|
||||||
|
* minimum: 32.1
|
||||||
|
* maximum: 543.2
|
||||||
|
* @return number
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public BigDecimal getNumber() {
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumber(BigDecimal number) {
|
||||||
|
this.number = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest _float(Float _float) {
|
||||||
|
this._float = _float;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get _float
|
||||||
|
* minimum: 54.3
|
||||||
|
* maximum: 987.6
|
||||||
|
* @return _float
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Float getFloat() {
|
||||||
|
return _float;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFloat(Float _float) {
|
||||||
|
this._float = _float;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest _double(Double _double) {
|
||||||
|
this._double = _double;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get _double
|
||||||
|
* minimum: 67.8
|
||||||
|
* maximum: 123.4
|
||||||
|
* @return _double
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Double getDouble() {
|
||||||
|
return _double;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDouble(Double _double) {
|
||||||
|
this._double = _double;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest string(String string) {
|
||||||
|
this.string = string;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get string
|
||||||
|
* @return string
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getString() {
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setString(String string) {
|
||||||
|
this.string = string;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest _byte(byte[] _byte) {
|
||||||
|
this._byte = _byte;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get _byte
|
||||||
|
* @return _byte
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public byte[] getByte() {
|
||||||
|
return _byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setByte(byte[] _byte) {
|
||||||
|
this._byte = _byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest binary(byte[] binary) {
|
||||||
|
this.binary = binary;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get binary
|
||||||
|
* @return binary
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public byte[] getBinary() {
|
||||||
|
return binary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBinary(byte[] binary) {
|
||||||
|
this.binary = binary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest date(LocalDate date) {
|
||||||
|
this.date = date;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get date
|
||||||
|
* @return date
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public LocalDate getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(LocalDate date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest dateTime(OffsetDateTime dateTime) {
|
||||||
|
this.dateTime = dateTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get dateTime
|
||||||
|
* @return dateTime
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public OffsetDateTime getDateTime() {
|
||||||
|
return dateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDateTime(OffsetDateTime dateTime) {
|
||||||
|
this.dateTime = dateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest uuid(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get uuid
|
||||||
|
* @return uuid
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public UUID getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormatTest password(String password) {
|
||||||
|
this.password = password;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get password
|
||||||
|
* @return password
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(required = true, value = "")
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FormatTest formatTest = (FormatTest) o;
|
||||||
|
return Objects.equals(this.integer, formatTest.integer) &&
|
||||||
|
Objects.equals(this.int32, formatTest.int32) &&
|
||||||
|
Objects.equals(this.int64, formatTest.int64) &&
|
||||||
|
Objects.equals(this.number, formatTest.number) &&
|
||||||
|
Objects.equals(this._float, formatTest._float) &&
|
||||||
|
Objects.equals(this._double, formatTest._double) &&
|
||||||
|
Objects.equals(this.string, formatTest.string) &&
|
||||||
|
Arrays.equals(this._byte, formatTest._byte) &&
|
||||||
|
Arrays.equals(this.binary, formatTest.binary) &&
|
||||||
|
Objects.equals(this.date, formatTest.date) &&
|
||||||
|
Objects.equals(this.dateTime, formatTest.dateTime) &&
|
||||||
|
Objects.equals(this.uuid, formatTest.uuid) &&
|
||||||
|
Objects.equals(this.password, formatTest.password);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class FormatTest {\n");
|
||||||
|
|
||||||
|
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
|
||||||
|
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
|
||||||
|
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
|
||||||
|
sb.append(" number: ").append(toIndentedString(number)).append("\n");
|
||||||
|
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
|
||||||
|
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
|
||||||
|
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||||
|
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
|
||||||
|
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||||
|
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||||
|
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||||
|
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||||
|
sb.append(" password: ").append(toIndentedString(password)).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,99 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HasOnlyReadOnly
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class HasOnlyReadOnly {
|
||||||
|
@SerializedName("bar")
|
||||||
|
private String bar = null;
|
||||||
|
|
||||||
|
@SerializedName("foo")
|
||||||
|
private String foo = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bar
|
||||||
|
* @return bar
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getBar() {
|
||||||
|
return bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get foo
|
||||||
|
* @return foo
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getFoo() {
|
||||||
|
return foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
|
||||||
|
return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
|
||||||
|
Objects.equals(this.foo, hasOnlyReadOnly.foo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(bar, foo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class HasOnlyReadOnly {\n");
|
||||||
|
|
||||||
|
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||||
|
sb.append(" foo: ").append(toIndentedString(foo)).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,183 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MapTest
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MapTest {
|
||||||
|
@SerializedName("map_map_of_string")
|
||||||
|
private Map<String, Map<String, String>> mapMapOfString = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or Sets inner
|
||||||
|
*/
|
||||||
|
@JsonAdapter(InnerEnum.Adapter.class)
|
||||||
|
public enum InnerEnum {
|
||||||
|
UPPER("UPPER"),
|
||||||
|
|
||||||
|
LOWER("lower");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
InnerEnum(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InnerEnum fromValue(String text) {
|
||||||
|
for (InnerEnum b : InnerEnum.values()) {
|
||||||
|
if (String.valueOf(b.value).equals(text)) {
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Adapter extends TypeAdapter<InnerEnum> {
|
||||||
|
@Override
|
||||||
|
public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException {
|
||||||
|
jsonWriter.value(enumeration.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InnerEnum read(final JsonReader jsonReader) throws IOException {
|
||||||
|
String value = jsonReader.nextString();
|
||||||
|
return InnerEnum.fromValue(String.valueOf(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SerializedName("map_of_enum_string")
|
||||||
|
private Map<String, InnerEnum> mapOfEnumString = null;
|
||||||
|
|
||||||
|
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||||
|
this.mapMapOfString = mapMapOfString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||||
|
if (this.mapMapOfString == null) {
|
||||||
|
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||||
|
}
|
||||||
|
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get mapMapOfString
|
||||||
|
* @return mapMapOfString
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||||
|
return mapMapOfString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||||
|
this.mapMapOfString = mapMapOfString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||||
|
this.mapOfEnumString = mapOfEnumString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||||
|
if (this.mapOfEnumString == null) {
|
||||||
|
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||||
|
}
|
||||||
|
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get mapOfEnumString
|
||||||
|
* @return mapOfEnumString
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||||
|
return mapOfEnumString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||||
|
this.mapOfEnumString = mapOfEnumString;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MapTest mapTest = (MapTest) o;
|
||||||
|
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
|
||||||
|
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(mapMapOfString, mapOfEnumString);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class MapTest {\n");
|
||||||
|
|
||||||
|
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
|
||||||
|
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).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,154 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.client.model.Animal;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||||
|
@SerializedName("uuid")
|
||||||
|
private UUID uuid = null;
|
||||||
|
|
||||||
|
@SerializedName("dateTime")
|
||||||
|
private OffsetDateTime dateTime = null;
|
||||||
|
|
||||||
|
@SerializedName("map")
|
||||||
|
private Map<String, Animal> map = null;
|
||||||
|
|
||||||
|
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get uuid
|
||||||
|
* @return uuid
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public UUID getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
|
||||||
|
this.dateTime = dateTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get dateTime
|
||||||
|
* @return dateTime
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public OffsetDateTime getDateTime() {
|
||||||
|
return dateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDateTime(OffsetDateTime dateTime) {
|
||||||
|
this.dateTime = dateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
|
||||||
|
this.map = map;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||||
|
if (this.map == null) {
|
||||||
|
this.map = new HashMap<String, Animal>();
|
||||||
|
}
|
||||||
|
this.map.put(key, mapItem);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get map
|
||||||
|
* @return map
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Map<String, Animal> getMap() {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMap(Map<String, Animal> map) {
|
||||||
|
this.map = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
|
||||||
|
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
|
||||||
|
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
|
||||||
|
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(uuid, dateTime, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
|
||||||
|
|
||||||
|
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||||
|
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||||
|
sb.append(" map: ").append(toIndentedString(map)).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,118 @@
|
|||||||
|
/*
|
||||||
|
* Swagger 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
|
||||||
|
* Contact: apiteam@swagger.io
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package io.swagger.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.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model for testing model name starting with number
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "Model for testing model name starting with number")
|
||||||
|
|
||||||
|
public class Model200Response {
|
||||||
|
@SerializedName("name")
|
||||||
|
private Integer name = null;
|
||||||
|
|
||||||
|
@SerializedName("class")
|
||||||
|
private String propertyClass = null;
|
||||||
|
|
||||||
|
public Model200Response name(Integer name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get name
|
||||||
|
* @return name
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(Integer name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Model200Response propertyClass(String propertyClass) {
|
||||||
|
this.propertyClass = propertyClass;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get propertyClass
|
||||||
|
* @return propertyClass
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public String getPropertyClass() {
|
||||||
|
return propertyClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPropertyClass(String propertyClass) {
|
||||||
|
this.propertyClass = propertyClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(java.lang.Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Model200Response _200Response = (Model200Response) o;
|
||||||
|
return Objects.equals(this.name, _200Response.name) &&
|
||||||
|
Objects.equals(this.propertyClass, _200Response.propertyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(name, propertyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class Model200Response {\n");
|
||||||
|
|
||||||
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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…
x
Reference in New Issue
Block a user