Merge pull request #3237 from wing328/java-security-fix

[Java] Better code injection handling for Java-related generators
This commit is contained in:
wing328 2016-06-29 15:25:10 +08:00 committed by GitHub
commit c5724a46d6
101 changed files with 7116 additions and 2213 deletions

View File

@ -0,0 +1,33 @@
#!/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/okhttp-gson -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore-security-test/java/okhttp-gson -DhideGenerationTimestamp=true"
rm -rf samples/client/petstore-security-test/java/okhttp-gson/src/main
find samples/client/petstore-security-test/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
java $JAVA_OPTS -jar $executable $ags

View File

@ -188,6 +188,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
} else { } else {
scheme = "https"; scheme = "https";
} }
scheme = config.escapeText(scheme);
hostBuilder.append(scheme); hostBuilder.append(scheme);
hostBuilder.append("://"); hostBuilder.append("://");
if (swagger.getHost() != null) { if (swagger.getHost() != null) {
@ -198,9 +199,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
if (swagger.getBasePath() != null) { if (swagger.getBasePath() != null) {
hostBuilder.append(swagger.getBasePath()); hostBuilder.append(swagger.getBasePath());
} }
String contextPath = swagger.getBasePath() == null ? "" : swagger.getBasePath(); String contextPath = config.escapeText(swagger.getBasePath() == null ? "" : swagger.getBasePath());
String basePath = hostBuilder.toString(); String basePath = config.escapeText(hostBuilder.toString());
String basePathWithoutHost = swagger.getBasePath(); String basePathWithoutHost = config.escapeText(swagger.getBasePath());
// resolve inline models // resolve inline models
InlineModelResolver inlineModelResolver = new InlineModelResolver(); InlineModelResolver inlineModelResolver = new InlineModelResolver();

View File

@ -833,4 +833,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public void setDateLibrary(String library) { public void setDateLibrary(String library) {
this.dateLibrary = library; this.dateLibrary = library;
} }
@Override
public String escapeQuotationMark(String input) {
// remove " to avoid code injection
return input.replace("\"", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("*/", "");
}
} }

View File

@ -211,4 +211,5 @@ public class JavaClientCodegen extends AbstractJavaCodegen {
public void setUseRxJava(boolean useRxJava) { public void setUseRxJava(boolean useRxJava) {
this.useRxJava = useRxJava; this.useRxJava = useRxJava;
} }
} }

View File

@ -29,7 +29,7 @@ public class ApiClient {
public interface Api {} public interface Api {}
protected ObjectMapper objectMapper; protected ObjectMapper objectMapper;
private String basePath = "{{basePath}}"; private String basePath = "{{{basePath}}}";
private Map<String, RequestInterceptor> apiAuthorizations; private Map<String, RequestInterceptor> apiAuthorizations;
private Feign.Builder feignBuilder; private Feign.Builder feignBuilder;

View File

@ -51,7 +51,7 @@ import {{invokerPackage}}.auth.OAuth;
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiClient { public class ApiClient {
private Map<String, String> defaultHeaderMap = new HashMap<String, String>(); private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private String basePath = "{{basePath}}"; private String basePath = "{{{basePath}}}";
private boolean debugging = false; private boolean debugging = false;
private int connectionTimeout = 0; private int connectionTimeout = 0;

View File

@ -101,7 +101,7 @@ public class ApiClient {
*/ */
public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
private String basePath = "{{basePath}}"; private String basePath = "{{{basePath}}}";
private boolean lenientOnJson = false; private boolean lenientOnJson = false;
private boolean debugging = false; private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>(); private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
@ -169,7 +169,7 @@ public class ApiClient {
/** /**
* Set base path * Set base path
* *
* @param basePath Base path of the URL (e.g {{basePath}}) * @param basePath Base path of the URL (e.g {{{basePath}}}
* @return An instance of OkHttpClient * @return An instance of OkHttpClient
*/ */
public ApiClient setBasePath(String basePath) { public ApiClient setBasePath(String basePath) {

View File

@ -123,7 +123,7 @@ public class ApiClient {
adapterBuilder = new RestAdapter adapterBuilder = new RestAdapter
.Builder() .Builder()
.setEndpoint("{{basePath}}") .setEndpoint("{{{basePath}}}")
.setClient(new OkClient(okClient)) .setClient(new OkClient(okClient))
.setConverter(new GsonConverterWrapper(gson)); .setConverter(new GsonConverterWrapper(gson));
} }

View File

@ -132,7 +132,7 @@ public class ApiClient {
okClient = new OkHttpClient(); okClient = new OkHttpClient();
String baseUrl = "{{basePath}}"; String baseUrl = "{{{basePath}}}";
if(!baseUrl.endsWith("/")) if(!baseUrl.endsWith("/"))
baseUrl = baseUrl + "/"; baseUrl = baseUrl + "/";

View File

@ -1,7 +1,7 @@
/** /**
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
*/ */
public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#gson}} {{#gson}}
{{#allowableValues}}{{#enumVars}} {{#allowableValues}}{{#enumVars}}
@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
@ -14,9 +14,9 @@ public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
{{/gson}} {{/gson}}
private {{dataType}} value; private {{{dataType}}} value;
{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
this.value = value; this.value = value;
} }

View File

@ -6,11 +6,15 @@
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
{{#vars}} {{#vars}}
{{#isEnum}} {{#isEnum}}
{{^isContainer}}
{{>modelInnerEnum}} {{>modelInnerEnum}}
{{/isContainer}}
{{/isEnum}} {{/isEnum}}
{{#items.isEnum}} {{#items.isEnum}}
{{#items}} {{#items}}
{{^isContainer}}
{{>modelInnerEnum}} {{>modelInnerEnum}}
{{/isContainer}}
{{/items}} {{/items}}
{{/items.isEnum}} {{/items.isEnum}}
{{#jackson}} {{#jackson}}

View 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

View File

@ -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

View File

@ -0,0 +1,29 @@
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
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

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,126 @@
# swagger-petstore-okhttp-gson
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation
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.
### Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-petstore-okhttp-gson</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```
### Gradle users
Add this dependency to your project's build file:
```groovy
compile "io.swagger:swagger-petstore-okhttp-gson:1.0.0"
```
### Others
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
* target/swagger-petstore-okhttp-gson-1.0.0.jar
* target/lib/*.jar
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
```java
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FakeApi;
import java.io.File;
import java.util.*;
public class FakeApiExample {
public static void main(String[] args) {
FakeApi apiInstance = new FakeApi();
String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection ' \" =end
try {
apiInstance.testCodeInjectEnd(testCodeInjectEnd);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testCodeInjectEnd");
e.printStackTrace();
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FakeApi* | [**testCodeInjectEnd**](docs/FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection &#39; \&quot; &#x3D;end
## Documentation for Models
- [ModelReturn](docs/ModelReturn.md)
## Documentation for Authorization
Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key */ &#39; &quot; &#x3D;end
- **Location**: HTTP header
### petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- write:pets: modify pets in your account */ &#39; &quot; &#x3D;end
- read:pets: read your pets */ &#39; &quot; &#x3D;end
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue.
## Author
apiteam@swagger.io &#39; \&quot; &#x3D;end

View File

@ -0,0 +1,103 @@
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 23
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// 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_7
targetCompatibility = JavaVersion.VERSION_1_7
install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-okhttp-gson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}
dependencies {
compile 'io.swagger:swagger-annotations:1.5.8'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.google.code.gson:gson:2.6.2'
compile 'joda-time:joda-time:2.9.3'
testCompile 'junit:junit:4.12'
}

View File

@ -0,0 +1,20 @@
lazy val root = (project in file(".")).
settings(
organization := "io.swagger",
name := "swagger-petstore-okhttp-gson",
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.8",
"com.squareup.okhttp" % "okhttp" % "2.7.5",
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
"com.google.code.gson" % "gson" % "2.6.2",
"joda-time" % "joda-time" % "2.9.3" % "compile",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
)

View File

@ -0,0 +1,51 @@
# FakeApi
All URIs are relative to *https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection &#39; \&quot; &#x3D;end
<a name="testCodeInjectEnd"></a>
# **testCodeInjectEnd**
> testCodeInjectEnd(testCodeInjectEnd)
To test code injection &#39; \&quot; &#x3D;end
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection ' \" =end
try {
apiInstance.testCodeInjectEnd(testCodeInjectEnd);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testCodeInjectEnd");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**testCodeInjectEnd** | **String**| To test code injection &#39; \&quot; &#x3D;end | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, */ ' =end
- **Accept**: application/json, */ ' =end

View File

@ -0,0 +1,10 @@
# ModelReturn
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | property description &#39; \&quot; &#x3D;end | [optional]

View 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 crediential 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'

View File

@ -0,0 +1,2 @@
# Uncomment to build for Android
#target = android

View 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

View 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 "$@"

View 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

View File

@ -0,0 +1,148 @@
<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-okhttp-gson</artifactId>
<packaging>jar</packaging>
<name>swagger-petstore-okhttp-gson</name>
<version>1.0.0</version>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-mustache.git</connection>
<developerConnection>scm:git:git@github.com:swagger-api/swagger-codegen.git</developerConnection>
<url>https://github.com/swagger-api/swagger-codegen</url>
</scm>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- attach test jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp-version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.9</swagger-core-version>
<okhttp-version>2.7.5</okhttp-version>
<gson-version>2.6.2</gson-version>
<jodatime-version>2.9.3</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.12</junit-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -0,0 +1 @@
rootProject.name = "swagger-petstore-okhttp-gson"

View File

@ -0,0 +1,3 @@
<manifest package="io.swagger.client" xmlns:android="http://schemas.android.com/apk/res/android">
<application />
</manifest>

View File

@ -0,0 +1,74 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API downlond processing.
*
* @param bytesRead bytes Read
* @param contentLength content lenngth of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}

View File

@ -0,0 +1,103 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import java.util.Map;
import java.util.List;
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
public ApiException() {}
public ApiException(Throwable throwable) {
super(throwable);
}
public ApiException(String message) {
super(message);
}
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
}
public ApiException(int code, String message) {
super(message);
this.code = code;
}
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
}

View File

@ -0,0 +1,71 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*
* @param T The type of data that is deserialized from response body
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
public int getStatusCode() {
return statusCode;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public T getData() {
return data;
}
}

View File

@ -0,0 +1,51 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();
/**
* Get the default API client, which would be used when creating API
* instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
return defaultApiClient;
}
/**
* Set the default API client, which would be used when creating API
* instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient = apiClient;
}
}

View File

@ -0,0 +1,236 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.util.Date;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
public class JSON {
private ApiClient apiClient;
private Gson gson;
/**
* JSON constructor.
*
* @param apiClient An instance of ApiClient
*/
public JSON(ApiClient apiClient) {
this.apiClient = apiClient;
gson = new GsonBuilder()
.registerTypeAdapter(Date.class, new DateAdapter(apiClient))
.registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter())
.registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter())
.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
*/
public void setGson(Gson gson) {
this.gson = gson;
}
/**
* 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 inot
* @return The deserialized Java object
*/
public <T> T deserialize(String body, Type returnType) {
try {
if (apiClient.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;
// parse response body into date or datetime for the Date return type.
if (returnType.equals(String.class))
return (T) body;
else if (returnType.equals(Date.class))
return (T) apiClient.parseDateOrDatetime(body);
else throw(e);
}
}
}
class DateAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
private final ApiClient apiClient;
/**
* Constructor for DateAdapter
*
* @param apiClient Api client
*/
public DateAdapter(ApiClient apiClient) {
super();
this.apiClient = apiClient;
}
/**
* Serialize
*
* @param src Date
* @param typeOfSrc Type
* @param context Json Serialization Context
* @return Json Element
*/
@Override
public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
if (src == null) {
return JsonNull.INSTANCE;
} else {
return new JsonPrimitive(apiClient.formatDatetime(src));
}
}
/**
* Deserialize
*
* @param json Json element
* @param date Type
* @param typeOfSrc Type
* @param context Json Serialization Context
* @return Date
* @throw JsonParseException if fail to parse
*/
@Override
public Date deserialize(JsonElement json, Type date, JsonDeserializationContext context) throws JsonParseException {
String str = json.getAsJsonPrimitive().getAsString();
try {
return apiClient.parseDateOrDatetime(str);
} catch (RuntimeException e) {
throw new JsonParseException(e);
}
}
}
/**
* Gson TypeAdapter for Joda DateTime type
*/
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();
@Override
public void write(JsonWriter out, DateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.print(date));
}
}
@Override
public DateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return formatter.parseDateTime(date);
}
}
}
/**
* Gson TypeAdapter for Joda LocalDate type
*/
class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private final DateTimeFormatter formatter = ISODateTimeFormat.date();
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.print(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return formatter.parseLocalDate(date);
}
}
}

View File

@ -0,0 +1,64 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
setName(name);
setValue(value);
}
private void setName(String name) {
if (!isValidString(name)) return;
this.name = name;
}
private void setValue(String value) {
if (!isValidString(value)) return;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) return false;
if (arg.trim().isEmpty()) return false;
return true;
}
}

View File

@ -0,0 +1,95 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
public interface ProgressRequestListener {
void onRequestProgress(long bytesWritten, long contentLength, boolean done);
}
private final RequestBody requestBody;
private final ProgressRequestListener progressListener;
private BufferedSink bufferedSink;
public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) {
this.requestBody = requestBody;
this.progressListener = progressListener;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
if (bufferedSink == null) {
bufferedSink = Okio.buffer(sink(sink));
}
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}

View File

@ -0,0 +1,88 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
public interface ProgressListener {
void update(long bytesRead, long contentLength, boolean done);
}
private final ResponseBody responseBody;
private final ProgressListener progressListener;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
this.responseBody = responseBody;
this.progressListener = progressListener;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() throws IOException {
return responseBody.contentLength();
}
@Override
public BufferedSource source() throws IOException {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}

View File

@ -0,0 +1,67 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client;
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
}

View File

@ -0,0 +1,166 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FakeApi {
private ApiClient apiClient;
public FakeApi() {
this(Configuration.getDefaultApiClient());
}
public FakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/* Build call for testCodeInjectEnd */
private com.squareup.okhttp.Call testCodeInjectEndCall(String testCodeInjectEnd, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (testCodeInjectEnd != null)
localVarFormParams.put("test code inject */ &#39; &quot; &#x3D;end", testCodeInjectEnd);
final String[] localVarAccepts = {
"application/json", "*/ ' =end"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "*/ ' =end"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* To test code injection &#39; \&quot; &#x3D;end
*
* @param testCodeInjectEnd To test code injection &#39; \&quot; &#x3D;end (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void testCodeInjectEnd(String testCodeInjectEnd) throws ApiException {
testCodeInjectEndWithHttpInfo(testCodeInjectEnd);
}
/**
* To test code injection &#39; \&quot; &#x3D;end
*
* @param testCodeInjectEnd To test code injection &#39; \&quot; &#x3D;end (optional)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> testCodeInjectEndWithHttpInfo(String testCodeInjectEnd) throws ApiException {
com.squareup.okhttp.Call call = testCodeInjectEndCall(testCodeInjectEnd, null, null);
return apiClient.execute(call);
}
/**
* To test code injection &#39; \&quot; &#x3D;end (asynchronously)
*
* @param testCodeInjectEnd To test code injection &#39; \&quot; &#x3D;end (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testCodeInjectEndAsync(String testCodeInjectEnd, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testCodeInjectEndCall(testCodeInjectEnd, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
}

View File

@ -0,0 +1,87 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if (location == "query") {
queryParams.add(new Pair(paramName, value));
} else if (location == "header") {
headerParams.put(paramName, value);
}
}
}

View File

@ -0,0 +1,41 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
}

View File

@ -0,0 +1,66 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import com.squareup.okhttp.Credentials;
import java.util.Map;
import java.util.List;
import java.io.UnsupportedEncodingException;
public class HttpBasicAuth implements Authentication {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (username == null && password == null) {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
}
}

View File

@ -0,0 +1,51 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.auth;
import io.swagger.client.Pair;
import java.util.Map;
import java.util.List;
public class OAuth implements Authentication {
private String accessToken;
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (accessToken != null) {
headerParams.put("Authorization", "Bearer " + accessToken);
}
}
}

View File

@ -0,0 +1,30 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.auth;
public enum OAuthFlow {
accessCode, implicit, password, application
}

View File

@ -0,0 +1,100 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing reserved words &#39; \&quot; &#x3D;end
*/
@ApiModel(description = "Model for testing reserved words ' \" =end")
public class ModelReturn {
@SerializedName("return")
private Integer _return = null;
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
/**
* property description ' \" =end
* @return _return
**/
@ApiModelProperty(example = "null", value = "property description ' \" =end")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(this._return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).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 ");
}
}

View File

@ -0,0 +1,60 @@
/**
* Swagger Petstore ' \" =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
*
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for FakeApi
*/
public class FakeApiTest {
private final FakeApi api = new FakeApi();
/**
* To test code injection &#39; \&quot; &#x3D;end
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testCodeInjectEndTest() throws ApiException {
String testCodeInjectEnd = null;
// api.testCodeInjectEnd(testCodeInjectEnd);
// TODO: test validations
}
}

View File

@ -0,0 +1,29 @@
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
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

View File

@ -0,0 +1,10 @@
# ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayArrayNumber** | [**List&lt;List&lt;BigDecimal&gt;&gt;**](List.md) | | [optional]

View File

@ -0,0 +1,10 @@
# ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayNumber** | [**List&lt;BigDecimal&gt;**](BigDecimal.md) | | [optional]

View File

@ -7,6 +7,13 @@ Name | Type | Description | Notes
**arrayOfString** | **List&lt;String&gt;** | | [optional] **arrayOfString** | **List&lt;String&gt;** | | [optional]
**arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional] **arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional]
**arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional] **arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional]
**arrayOfEnum** | [**List&lt;ArrayOfEnumEnum&gt;**](#List&lt;ArrayOfEnumEnum&gt;) | | [optional]
<a name="List<ArrayOfEnumEnum>"></a>
## Enum: List&lt;ArrayOfEnumEnum&gt;
Name | Value
---- | -----

View File

@ -4,9 +4,53 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection &#x3D;end
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
<a name="testCodeInjectEnd"></a>
# **testCodeInjectEnd**
> testCodeInjectEnd(testCodeInjectEnd)
To test code injection &#x3D;end
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
String testCodeInjectEnd = "testCodeInjectEnd_example"; // String | To test code injection =end
try {
apiInstance.testCodeInjectEnd(testCodeInjectEnd);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testCodeInjectEnd");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**testCodeInjectEnd** | **String**| To test code injection &#x3D;end | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, */ =end'));(phpinfo('
- **Accept**: application/json, */ end
<a name="testEndpointParameters"></a> <a name="testEndpointParameters"></a>
# **testEndpointParameters** # **testEndpointParameters**
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) > testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
@ -73,3 +117,49 @@ No authorization required
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
<a name="testEnumQueryParameters"></a>
# **testEnumQueryParameters**
> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble)
To test enum query parameters
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
try {
apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEnumQueryParameters");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@ -0,0 +1,11 @@
# HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional]
**foo** | **String** | | [optional]

View File

@ -0,0 +1,24 @@
# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapMapOfString** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapMapOfEnum** | [**Map&lt;String, Map&lt;String, InnerEnum&gt;&gt;**](#Map&lt;String, Map&lt;String, InnerEnum&gt;&gt;) | | [optional]
**mapOfEnumString** | [**Map&lt;String, InnerEnum&gt;**](#Map&lt;String, InnerEnum&gt;) | | [optional]
<a name="Map<String, Map<String, InnerEnum>>"></a>
## Enum: Map&lt;String, Map&lt;String, InnerEnum&gt;&gt;
Name | Value
---- | -----
<a name="Map<String, InnerEnum>"></a>
## Enum: Map&lt;String, InnerEnum&gt;
Name | Value
---- | -----

View File

@ -0,0 +1,10 @@
# NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]

View File

@ -0,0 +1 @@
Hello world!

View File

@ -173,8 +173,8 @@ public class ApiClient {
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>(); authentications = new HashMap<String, Authentication>();
authentications.put("petstore_auth", new OAuth());
authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("petstore_auth", new OAuth());
// Prevent the authentications from being modified. // Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications); authentications = Collections.unmodifiableMap(authentications);
} }
@ -191,7 +191,7 @@ public class ApiClient {
/** /**
* Set base path * Set base path
* *
* @param basePath Base path of the URL (e.g http://petstore.swagger.io/v2) * @param basePath Base path of the URL (e.g http://petstore.swagger.io/v2
* @return An instance of OkHttpClient * @return An instance of OkHttpClient
*/ */
public ApiClient setBasePath(String basePath) { public ApiClient setBasePath(String basePath) {

View File

@ -39,8 +39,8 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException; import java.io.IOException;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import java.math.BigDecimal;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import java.math.BigDecimal;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;
@ -67,6 +67,105 @@ public class FakeApi {
this.apiClient = apiClient; this.apiClient = apiClient;
} }
/* Build call for testCodeInjectEnd */
private com.squareup.okhttp.Call testCodeInjectEndCall(String testCodeInjectEnd, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (testCodeInjectEnd != null)
localVarFormParams.put("test code inject */ &#x3D;end", testCodeInjectEnd);
final String[] localVarAccepts = {
"application/json", "*/ end"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json", "*/ =end'));(phpinfo('"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* To test code injection &#x3D;end
*
* @param testCodeInjectEnd To test code injection &#x3D;end (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void testCodeInjectEnd(String testCodeInjectEnd) throws ApiException {
testCodeInjectEndWithHttpInfo(testCodeInjectEnd);
}
/**
* To test code injection &#x3D;end
*
* @param testCodeInjectEnd To test code injection &#x3D;end (optional)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> testCodeInjectEndWithHttpInfo(String testCodeInjectEnd) throws ApiException {
com.squareup.okhttp.Call call = testCodeInjectEndCall(testCodeInjectEnd, null, null);
return apiClient.execute(call);
}
/**
* To test code injection &#x3D;end (asynchronously)
*
* @param testCodeInjectEnd To test code injection &#x3D;end (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testCodeInjectEndAsync(String testCodeInjectEnd, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testCodeInjectEndCall(testCodeInjectEnd, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/* Build call for testEndpointParameters */ /* Build call for testEndpointParameters */
private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, LocalDate date, DateTime dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, LocalDate date, DateTime dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
@ -241,4 +340,113 @@ public class FakeApi {
apiClient.executeAsync(call, callback); apiClient.executeAsync(call, callback);
return call; return call;
} }
/* Build call for testEnumQueryParameters */
private com.squareup.okhttp.Call testEnumQueryParametersCall(String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
List<Pair> localVarQueryParams = new ArrayList<Pair>();
if (enumQueryInteger != null)
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (enumQueryString != null)
localVarFormParams.put("enum_query_string", enumQueryString);
if (enumQueryDouble != null)
localVarFormParams.put("enum_query_double", enumQueryDouble);
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
/**
* To test enum query parameters
*
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void testEnumQueryParameters(String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
testEnumQueryParametersWithHttpInfo(enumQueryString, enumQueryInteger, enumQueryDouble);
}
/**
* To test enum query parameters
*
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> testEnumQueryParametersWithHttpInfo(String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
com.squareup.okhttp.Call call = testEnumQueryParametersCall(enumQueryString, enumQueryInteger, enumQueryDouble, null, null);
return apiClient.execute(call);
}
/**
* To test enum query parameters (asynchronously)
*
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testEnumQueryParametersAsync(String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testEnumQueryParametersCall(enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
} }

View File

@ -39,8 +39,8 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException; import java.io.IOException;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import io.swagger.client.model.ModelApiResponse;
import java.io.File; import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -26,63 +26,64 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.gson.annotations.SerializedName;
/** /**
* AdditionalPropertiesClass * AdditionalPropertiesClass
*/ */
public class AdditionalPropertiesClass { public class AdditionalPropertiesClass {
@SerializedName("map_property") @SerializedName("map_property")
private Map<String, String> mapProperty = new HashMap<String, String>(); private Map<String, String> mapProperty = new HashMap<String, String>();
@SerializedName("map_of_map_property") @SerializedName("map_of_map_property")
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>(); private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
return this;
}
/** /**
* Get mapProperty * Get mapProperty
* @return mapProperty * @return mapProperty
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Map<String, String> getMapProperty() { public Map<String, String> getMapProperty() {
return mapProperty; return mapProperty;
} }
/**
* Set mapProperty
*
* @param mapProperty mapProperty
*/
public void setMapProperty(Map<String, String> mapProperty) { public void setMapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty; this.mapProperty = mapProperty;
} }
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
return this;
}
/** /**
* Get mapOfMapProperty * Get mapOfMapProperty
* @return mapOfMapProperty * @return mapOfMapProperty
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, String>> getMapOfMapProperty() { public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty; return mapOfMapProperty;
} }
/**
* Set mapOfMapProperty
*
* @param mapOfMapProperty mapOfMapProperty
*/
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) { public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty; this.mapOfMapProperty = mapOfMapProperty;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -113,10 +114,8 @@ public class AdditionalPropertiesClass {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,60 +26,61 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Animal * Animal
*/ */
public class Animal { public class Animal {
@SerializedName("className") @SerializedName("className")
private String className = null; private String className = null;
@SerializedName("color") @SerializedName("color")
private String color = "red"; private String color = "red";
public Animal className(String className) {
this.className = className;
return this;
}
/** /**
* Get className * Get className
* @return className * @return className
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() { public String getClassName() {
return className; return className;
} }
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
public Animal color(String color) {
this.color = color;
return this;
}
/** /**
* Get color * Get color
* @return color * @return color
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getColor() { public String getColor() {
return color; return color;
} }
/**
* Set color
*
* @param color color
*/
public void setColor(String color) { public void setColor(String color) {
this.color = color; this.color = color;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -110,10 +111,8 @@ public class Animal {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -30,17 +30,15 @@ import io.swagger.client.model.Animal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.gson.annotations.SerializedName;
/** /**
* AnimalFarm * AnimalFarm
*/ */
public class AnimalFarm extends ArrayList<Animal> { public class AnimalFarm extends ArrayList<Animal> {
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -67,10 +65,8 @@ public class AnimalFarm extends ArrayList<Animal> {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -0,0 +1,102 @@
/**
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* ArrayOfArrayOfNumberOnly
*/
public class ArrayOfArrayOfNumberOnly {
@SerializedName("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return this;
}
/**
* Get arrayArrayNumber
* @return arrayArrayNumber
**/
@ApiModelProperty(example = "null", 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 ");
}
}

View File

@ -0,0 +1,102 @@
/**
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* ArrayOfNumberOnly
*/
public class ArrayOfNumberOnly {
@SerializedName("ArrayNumber")
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
return this;
}
/**
* Get arrayNumber
* @return arrayNumber
**/
@ApiModelProperty(example = "null", 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 ");
}
}

View File

@ -26,82 +26,128 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.ReadOnlyFirst;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.gson.annotations.SerializedName;
/** /**
* ArrayTest * ArrayTest
*/ */
public class ArrayTest { public class ArrayTest {
@SerializedName("array_of_string") @SerializedName("array_of_string")
private List<String> arrayOfString = new ArrayList<String>(); private List<String> arrayOfString = new ArrayList<String>();
@SerializedName("array_array_of_integer") @SerializedName("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>(); private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
@SerializedName("array_array_of_model") @SerializedName("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>(); private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
/**
* Gets or Sets arrayOfEnum
*/
public enum ArrayOfEnumEnum {
@SerializedName("UPPER")
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
private String value;
ArrayOfEnumEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}
@SerializedName("array_of_enum")
private List<ArrayOfEnumEnum> arrayOfEnum = new ArrayList<ArrayOfEnumEnum>();
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
/** /**
* Get arrayOfString * Get arrayOfString
* @return arrayOfString * @return arrayOfString
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public List<String> getArrayOfString() { public List<String> getArrayOfString() {
return arrayOfString; return arrayOfString;
} }
/**
* Set arrayOfString
*
* @param arrayOfString arrayOfString
*/
public void setArrayOfString(List<String> arrayOfString) { public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString; this.arrayOfString = arrayOfString;
} }
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
/** /**
* Get arrayArrayOfInteger * Get arrayArrayOfInteger
* @return arrayArrayOfInteger * @return arrayArrayOfInteger
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public List<List<Long>> getArrayArrayOfInteger() { public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger; return arrayArrayOfInteger;
} }
/**
* Set arrayArrayOfInteger
*
* @param arrayArrayOfInteger arrayArrayOfInteger
*/
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) { public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger; this.arrayArrayOfInteger = arrayArrayOfInteger;
} }
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
/** /**
* Get arrayArrayOfModel * Get arrayArrayOfModel
* @return arrayArrayOfModel * @return arrayArrayOfModel
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() { public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel; return arrayArrayOfModel;
} }
/**
* Set arrayArrayOfModel
*
* @param arrayArrayOfModel arrayArrayOfModel
*/
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) { public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel; this.arrayArrayOfModel = arrayArrayOfModel;
} }
public ArrayTest arrayOfEnum(List<ArrayOfEnumEnum> arrayOfEnum) {
this.arrayOfEnum = arrayOfEnum;
return this;
}
/**
* Get arrayOfEnum
* @return arrayOfEnum
**/
@ApiModelProperty(example = "null", value = "")
public List<ArrayOfEnumEnum> getArrayOfEnum() {
return arrayOfEnum;
}
public void setArrayOfEnum(List<ArrayOfEnumEnum> arrayOfEnum) {
this.arrayOfEnum = arrayOfEnum;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -111,12 +157,13 @@ public class ArrayTest {
ArrayTest arrayTest = (ArrayTest) o; ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel) &&
Objects.equals(this.arrayOfEnum, arrayTest.arrayOfEnum);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel, arrayOfEnum);
} }
@Override @Override
@ -127,6 +174,7 @@ public class ArrayTest {
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
sb.append(" arrayOfEnum: ").append(toIndentedString(arrayOfEnum)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }
@ -134,10 +182,8 @@ public class ArrayTest {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,81 +26,83 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal; import io.swagger.client.model.Animal;
import com.google.gson.annotations.SerializedName;
/** /**
* Cat * Cat
*/ */
public class Cat extends Animal { public class Cat extends Animal {
@SerializedName("className") @SerializedName("className")
private String className = null; private String className = null;
@SerializedName("color") @SerializedName("color")
private String color = "red"; private String color = "red";
@SerializedName("declawed") @SerializedName("declawed")
private Boolean declawed = null; private Boolean declawed = null;
public Cat className(String className) {
this.className = className;
return this;
}
/** /**
* Get className * Get className
* @return className * @return className
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() { public String getClassName() {
return className; return className;
} }
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
public Cat color(String color) {
this.color = color;
return this;
}
/** /**
* Get color * Get color
* @return color * @return color
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getColor() { public String getColor() {
return color; return color;
} }
/**
* Set color
*
* @param color color
*/
public void setColor(String color) { public void setColor(String color) {
this.color = color; this.color = color;
} }
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
/** /**
* Get declawed * Get declawed
* @return declawed * @return declawed
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Boolean getDeclawed() { public Boolean getDeclawed() {
return declawed; return declawed;
} }
/**
* Set declawed
*
* @param declawed declawed
*/
public void setDeclawed(Boolean declawed) { public void setDeclawed(Boolean declawed) {
this.declawed = declawed; this.declawed = declawed;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -134,10 +136,8 @@ public class Cat extends Animal {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,60 +26,61 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Category * Category
*/ */
public class Category { public class Category {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@SerializedName("name") @SerializedName("name")
private String name = null; private String name = null;
public Category id(Long id) {
this.id = id;
return this;
}
/** /**
* Get id * Get id
* @return id * @return id
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
/**
* Set id
*
* @param id id
*/
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Category name(String name) {
this.name = name;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getName() { public String getName() {
return name; return name;
} }
/**
* Set name
*
* @param name name
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -110,10 +111,8 @@ public class Category {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,81 +26,83 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal; import io.swagger.client.model.Animal;
import com.google.gson.annotations.SerializedName;
/** /**
* Dog * Dog
*/ */
public class Dog extends Animal { public class Dog extends Animal {
@SerializedName("className") @SerializedName("className")
private String className = null; private String className = null;
@SerializedName("color") @SerializedName("color")
private String color = "red"; private String color = "red";
@SerializedName("breed") @SerializedName("breed")
private String breed = null; private String breed = null;
public Dog className(String className) {
this.className = className;
return this;
}
/** /**
* Get className * Get className
* @return className * @return className
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() { public String getClassName() {
return className; return className;
} }
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
public Dog color(String color) {
this.color = color;
return this;
}
/** /**
* Get color * Get color
* @return color * @return color
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getColor() { public String getColor() {
return color; return color;
} }
/**
* Set color
*
* @param color color
*/
public void setColor(String color) { public void setColor(String color) {
this.color = color; this.color = color;
} }
public Dog breed(String breed) {
this.breed = breed;
return this;
}
/** /**
* Get breed * Get breed
* @return breed * @return breed
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getBreed() { public String getBreed() {
return breed; return breed;
} }
/**
* Set breed
*
* @param breed breed
*/
public void setBreed(String breed) { public void setBreed(String breed) {
this.breed = breed; this.breed = breed;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -134,10 +136,8 @@ public class Dog extends Animal {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,7 +26,6 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
@ -34,6 +33,7 @@ import com.google.gson.annotations.SerializedName;
* Gets or Sets EnumClass * Gets or Sets EnumClass
*/ */
public enum EnumClass { public enum EnumClass {
@SerializedName("_abc") @SerializedName("_abc")
_ABC("_abc"), _ABC("_abc"),

View File

@ -26,15 +26,15 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* EnumTest * EnumTest
*/ */
public class EnumTest { public class EnumTest {
/** /**
* Gets or Sets enumString * Gets or Sets enumString
@ -60,6 +60,7 @@ public class EnumTest {
@SerializedName("enum_string") @SerializedName("enum_string")
private EnumStringEnum enumString = null; private EnumStringEnum enumString = null;
/** /**
* Gets or Sets enumInteger * Gets or Sets enumInteger
*/ */
@ -84,6 +85,7 @@ public class EnumTest {
@SerializedName("enum_integer") @SerializedName("enum_integer")
private EnumIntegerEnum enumInteger = null; private EnumIntegerEnum enumInteger = null;
/** /**
* Gets or Sets enumNumber * Gets or Sets enumNumber
*/ */
@ -109,63 +111,63 @@ public class EnumTest {
@SerializedName("enum_number") @SerializedName("enum_number")
private EnumNumberEnum enumNumber = null; private EnumNumberEnum enumNumber = null;
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
}
/** /**
* Get enumString * Get enumString
* @return enumString * @return enumString
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public EnumStringEnum getEnumString() { public EnumStringEnum getEnumString() {
return enumString; return enumString;
} }
/**
* Set enumString
*
* @param enumString enumString
*/
public void setEnumString(EnumStringEnum enumString) { public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString; this.enumString = enumString;
} }
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
}
/** /**
* Get enumInteger * Get enumInteger
* @return enumInteger * @return enumInteger
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public EnumIntegerEnum getEnumInteger() { public EnumIntegerEnum getEnumInteger() {
return enumInteger; return enumInteger;
} }
/**
* Set enumInteger
*
* @param enumInteger enumInteger
*/
public void setEnumInteger(EnumIntegerEnum enumInteger) { public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger; this.enumInteger = enumInteger;
} }
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return this;
}
/** /**
* Get enumNumber * Get enumNumber
* @return enumNumber * @return enumNumber
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public EnumNumberEnum getEnumNumber() { public EnumNumberEnum getEnumNumber() {
return enumNumber; return enumNumber;
} }
/**
* Set enumNumber
*
* @param enumNumber enumNumber
*/
public void setEnumNumber(EnumNumberEnum enumNumber) { public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber; this.enumNumber = enumNumber;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -198,10 +200,8 @@ public class EnumTest {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,293 +26,305 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import com.google.gson.annotations.SerializedName;
/** /**
* FormatTest * FormatTest
*/ */
public class FormatTest { public class FormatTest {
@SerializedName("integer") @SerializedName("integer")
private Integer integer = null; private Integer integer = null;
@SerializedName("int32") @SerializedName("int32")
private Integer int32 = null; private Integer int32 = null;
@SerializedName("int64") @SerializedName("int64")
private Long int64 = null; private Long int64 = null;
@SerializedName("number") @SerializedName("number")
private BigDecimal number = null; private BigDecimal number = null;
@SerializedName("float") @SerializedName("float")
private Float _float = null; private Float _float = null;
@SerializedName("double") @SerializedName("double")
private Double _double = null; private Double _double = null;
@SerializedName("string") @SerializedName("string")
private String string = null; private String string = null;
@SerializedName("byte") @SerializedName("byte")
private byte[] _byte = null; private byte[] _byte = null;
@SerializedName("binary") @SerializedName("binary")
private byte[] binary = null; private byte[] binary = null;
@SerializedName("date") @SerializedName("date")
private LocalDate date = null; private LocalDate date = null;
@SerializedName("dateTime") @SerializedName("dateTime")
private DateTime dateTime = null; private DateTime dateTime = null;
@SerializedName("uuid") @SerializedName("uuid")
private String uuid = null; private String uuid = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
/** /**
* Get integer * Get integer
* minimum: 10.0 * minimum: 10.0
* maximum: 100.0 * maximum: 100.0
* @return integer * @return integer
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getInteger() { public Integer getInteger() {
return integer; return integer;
} }
/**
* Set integer
*
* @param integer integer
*/
public void setInteger(Integer integer) { public void setInteger(Integer integer) {
this.integer = integer; this.integer = integer;
} }
public FormatTest int32(Integer int32) {
this.int32 = int32;
return this;
}
/** /**
* Get int32 * Get int32
* minimum: 20.0 * minimum: 20.0
* maximum: 200.0 * maximum: 200.0
* @return int32 * @return int32
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getInt32() { public Integer getInt32() {
return int32; return int32;
} }
/**
* Set int32
*
* @param int32 int32
*/
public void setInt32(Integer int32) { public void setInt32(Integer int32) {
this.int32 = int32; this.int32 = int32;
} }
public FormatTest int64(Long int64) {
this.int64 = int64;
return this;
}
/** /**
* Get int64 * Get int64
* @return int64 * @return int64
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getInt64() { public Long getInt64() {
return int64; return int64;
} }
/**
* Set int64
*
* @param int64 int64
*/
public void setInt64(Long int64) { public void setInt64(Long int64) {
this.int64 = int64; this.int64 = int64;
} }
public FormatTest number(BigDecimal number) {
this.number = number;
return this;
}
/** /**
* Get number * Get number
* minimum: 32.1 * minimum: 32.1
* maximum: 543.2 * maximum: 543.2
* @return number * @return number
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public BigDecimal getNumber() { public BigDecimal getNumber() {
return number; return number;
} }
/**
* Set number
*
* @param number number
*/
public void setNumber(BigDecimal number) { public void setNumber(BigDecimal number) {
this.number = number; this.number = number;
} }
public FormatTest _float(Float _float) {
this._float = _float;
return this;
}
/** /**
* Get _float * Get _float
* minimum: 54.3 * minimum: 54.3
* maximum: 987.6 * maximum: 987.6
* @return _float * @return _float
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Float getFloat() { public Float getFloat() {
return _float; return _float;
} }
/**
* Set _float
*
* @param _float _float
*/
public void setFloat(Float _float) { public void setFloat(Float _float) {
this._float = _float; this._float = _float;
} }
public FormatTest _double(Double _double) {
this._double = _double;
return this;
}
/** /**
* Get _double * Get _double
* minimum: 67.8 * minimum: 67.8
* maximum: 123.4 * maximum: 123.4
* @return _double * @return _double
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Double getDouble() { public Double getDouble() {
return _double; return _double;
} }
/**
* Set _double
*
* @param _double _double
*/
public void setDouble(Double _double) { public void setDouble(Double _double) {
this._double = _double; this._double = _double;
} }
public FormatTest string(String string) {
this.string = string;
return this;
}
/** /**
* Get string * Get string
* @return string * @return string
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getString() { public String getString() {
return string; return string;
} }
/**
* Set string
*
* @param string string
*/
public void setString(String string) { public void setString(String string) {
this.string = string; this.string = string;
} }
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
/** /**
* Get _byte * Get _byte
* @return _byte * @return _byte
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public byte[] getByte() { public byte[] getByte() {
return _byte; return _byte;
} }
/**
* Set _byte
*
* @param _byte _byte
*/
public void setByte(byte[] _byte) { public void setByte(byte[] _byte) {
this._byte = _byte; this._byte = _byte;
} }
public FormatTest binary(byte[] binary) {
this.binary = binary;
return this;
}
/** /**
* Get binary * Get binary
* @return binary * @return binary
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public byte[] getBinary() { public byte[] getBinary() {
return binary; return binary;
} }
/**
* Set binary
*
* @param binary binary
*/
public void setBinary(byte[] binary) { public void setBinary(byte[] binary) {
this.binary = binary; this.binary = binary;
} }
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
/** /**
* Get date * Get date
* @return date * @return date
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public LocalDate getDate() { public LocalDate getDate() {
return date; return date;
} }
/**
* Set date
*
* @param date date
*/
public void setDate(LocalDate date) { public void setDate(LocalDate date) {
this.date = date; this.date = date;
} }
public FormatTest dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
/** /**
* Get dateTime * Get dateTime
* @return dateTime * @return dateTime
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public DateTime getDateTime() { public DateTime getDateTime() {
return dateTime; return dateTime;
} }
/**
* Set dateTime
*
* @param dateTime dateTime
*/
public void setDateTime(DateTime dateTime) { public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
} }
public FormatTest uuid(String uuid) {
this.uuid = uuid;
return this;
}
/** /**
* Get uuid * Get uuid
* @return uuid * @return uuid
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getUuid() { public String getUuid() {
return uuid; return uuid;
} }
/**
* Set uuid
*
* @param uuid uuid
*/
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }
public FormatTest password(String password) {
this.password = password;
return this;
}
/** /**
* Get password * Get password
* @return password * @return password
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public String getPassword() { public String getPassword() {
return password; return password;
} }
/**
* Set password
*
* @param password password
*/
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -365,10 +377,8 @@ public class FormatTest {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -0,0 +1,104 @@
/**
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* HasOnlyReadOnly
*/
public class HasOnlyReadOnly {
@SerializedName("bar")
private String bar = null;
@SerializedName("foo")
private String foo = null;
/**
* Get bar
* @return bar
**/
@ApiModelProperty(example = "null", value = "")
public String getBar() {
return bar;
}
/**
* Get foo
* @return foo
**/
@ApiModelProperty(example = "null", 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 ");
}
}

View File

@ -0,0 +1,170 @@
/**
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
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 = new HashMap<String, Map<String, String>>();
@SerializedName("map_map_of_enum")
private Map<String, Map<String, InnerEnum>> mapMapOfEnum = new HashMap<String, Map<String, InnerEnum>>();
/**
* Gets or Sets inner
*/
public enum InnerEnum {
@SerializedName("UPPER")
UPPER("UPPER"),
@SerializedName("lower")
LOWER("lower");
private String value;
InnerEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}
@SerializedName("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
}
/**
* Get mapMapOfString
* @return mapMapOfString
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, String>> getMapMapOfString() {
return mapMapOfString;
}
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
}
public MapTest mapMapOfEnum(Map<String, Map<String, InnerEnum>> mapMapOfEnum) {
this.mapMapOfEnum = mapMapOfEnum;
return this;
}
/**
* Get mapMapOfEnum
* @return mapMapOfEnum
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, InnerEnum>> getMapMapOfEnum() {
return mapMapOfEnum;
}
public void setMapMapOfEnum(Map<String, Map<String, InnerEnum>> mapMapOfEnum) {
this.mapMapOfEnum = mapMapOfEnum;
}
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
return this;
}
/**
* Get mapOfEnumString
* @return mapOfEnumString
**/
@ApiModelProperty(example = "null", 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.mapMapOfEnum, mapTest.mapMapOfEnum) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapMapOfEnum, mapOfEnumString);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MapTest {\n");
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapMapOfEnum: ").append(toIndentedString(mapMapOfEnum)).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 ");
}
}

View File

@ -26,6 +26,7 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal; import io.swagger.client.model.Animal;
@ -34,77 +35,78 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import com.google.gson.annotations.SerializedName;
/** /**
* MixedPropertiesAndAdditionalPropertiesClass * MixedPropertiesAndAdditionalPropertiesClass
*/ */
public class MixedPropertiesAndAdditionalPropertiesClass { public class MixedPropertiesAndAdditionalPropertiesClass {
@SerializedName("uuid") @SerializedName("uuid")
private String uuid = null; private String uuid = null;
@SerializedName("dateTime") @SerializedName("dateTime")
private DateTime dateTime = null; private DateTime dateTime = null;
@SerializedName("map") @SerializedName("map")
private Map<String, Animal> map = new HashMap<String, Animal>(); private Map<String, Animal> map = new HashMap<String, Animal>();
public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) {
this.uuid = uuid;
return this;
}
/** /**
* Get uuid * Get uuid
* @return uuid * @return uuid
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getUuid() { public String getUuid() {
return uuid; return uuid;
} }
/**
* Set uuid
*
* @param uuid uuid
*/
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
/** /**
* Get dateTime * Get dateTime
* @return dateTime * @return dateTime
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public DateTime getDateTime() { public DateTime getDateTime() {
return dateTime; return dateTime;
} }
/**
* Set dateTime
*
* @param dateTime dateTime
*/
public void setDateTime(DateTime dateTime) { public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
} }
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;
return this;
}
/** /**
* Get map * Get map
* @return map * @return map
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Map<String, Animal> getMap() { public Map<String, Animal> getMap() {
return map; return map;
} }
/**
* Set map
*
* @param map map
*/
public void setMap(Map<String, Animal> map) { public void setMap(Map<String, Animal> map) {
this.map = map; this.map = map;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -137,10 +139,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,61 +26,62 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Model for testing model name starting with number * Model for testing model name starting with number
*/ */
@ApiModel(description = "Model for testing model name starting with number") @ApiModel(description = "Model for testing model name starting with number")
public class Model200Response { public class Model200Response {
@SerializedName("name") @SerializedName("name")
private Integer name = null; private Integer name = null;
@SerializedName("class") @SerializedName("class")
private String PropertyClass = null; private String PropertyClass = null;
public Model200Response name(Integer name) {
this.name = name;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getName() { public Integer getName() {
return name; return name;
} }
/**
* Set name
*
* @param name name
*/
public void setName(Integer name) { public void setName(Integer name) {
this.name = name; this.name = name;
} }
public Model200Response PropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
return this;
}
/** /**
* Get PropertyClass * Get PropertyClass
* @return PropertyClass * @return PropertyClass
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getPropertyClass() { public String getPropertyClass() {
return PropertyClass; return PropertyClass;
} }
/**
* Set PropertyClass
*
* @param PropertyClass PropertyClass
*/
public void setPropertyClass(String PropertyClass) { public void setPropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass; this.PropertyClass = PropertyClass;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -111,10 +112,8 @@ public class Model200Response {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,80 +26,82 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* ModelApiResponse * ModelApiResponse
*/ */
public class ModelApiResponse { public class ModelApiResponse {
@SerializedName("code") @SerializedName("code")
private Integer code = null; private Integer code = null;
@SerializedName("type") @SerializedName("type")
private String type = null; private String type = null;
@SerializedName("message") @SerializedName("message")
private String message = null; private String message = null;
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/** /**
* Get code * Get code
* @return code * @return code
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getCode() { public Integer getCode() {
return code; return code;
} }
/**
* Set code
*
* @param code code
*/
public void setCode(Integer code) { public void setCode(Integer code) {
this.code = code; this.code = code;
} }
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/** /**
* Get type * Get type
* @return type * @return type
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getType() { public String getType() {
return type; return type;
} }
/**
* Set type
*
* @param type type
*/
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
/** /**
* Get message * Get message
* @return message * @return message
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getMessage() { public String getMessage() {
return message; return message;
} }
/**
* Set message
*
* @param message message
*/
public void setMessage(String message) { public void setMessage(String message) {
this.message = message; this.message = message;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -132,10 +134,8 @@ public class ModelApiResponse {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,41 +26,41 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Model for testing reserved words * Model for testing reserved words
*/ */
@ApiModel(description = "Model for testing reserved words") @ApiModel(description = "Model for testing reserved words")
public class ModelReturn { public class ModelReturn {
@SerializedName("return") @SerializedName("return")
private Integer _return = null; private Integer _return = null;
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
/** /**
* Get _return * Get _return
* @return _return * @return _return
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getReturn() { public Integer getReturn() {
return _return; return _return;
} }
/**
* Set _return
*
* @param _return _return
*/
public void setReturn(Integer _return) { public void setReturn(Integer _return) {
this._return = _return; this._return = _return;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -89,10 +89,8 @@ public class ModelReturn {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,40 +26,43 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Model for testing model name same as property name * Model for testing model name same as property name
*/ */
@ApiModel(description = "Model for testing model name same as property name") @ApiModel(description = "Model for testing model name same as property name")
public class Name { public class Name {
@SerializedName("name") @SerializedName("name")
private Integer name = null; private Integer name = null;
@SerializedName("snake_case") @SerializedName("snake_case")
private Integer snakeCase = null; private Integer snakeCase = null;
@SerializedName("property") @SerializedName("property")
private String property = null; private String property = null;
@SerializedName("123Number") @SerializedName("123Number")
private Integer _123Number = null; private Integer _123Number = null;
public Name name(Integer name) {
this.name = name;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public Integer getName() { public Integer getName() {
return name; return name;
} }
/**
* Set name
*
* @param name name
*/
public void setName(Integer name) { public void setName(Integer name) {
this.name = name; this.name = name;
} }
@ -68,25 +71,25 @@ public class Name {
* Get snakeCase * Get snakeCase
* @return snakeCase * @return snakeCase
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getSnakeCase() { public Integer getSnakeCase() {
return snakeCase; return snakeCase;
} }
public Name property(String property) {
this.property = property;
return this;
}
/** /**
* Get property * Get property
* @return property * @return property
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getProperty() { public String getProperty() {
return property; return property;
} }
/**
* Set property
*
* @param property property
*/
public void setProperty(String property) { public void setProperty(String property) {
this.property = property; this.property = property;
} }
@ -95,14 +98,14 @@ public class Name {
* Get _123Number * Get _123Number
* @return _123Number * @return _123Number
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer get123Number() { public Integer get123Number() {
return _123Number; return _123Number;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -137,10 +140,8 @@ public class Name {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -0,0 +1,100 @@
/**
* 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* NumberOnly
*/
public class NumberOnly {
@SerializedName("JustNumber")
private BigDecimal justNumber = null;
public NumberOnly justNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
return this;
}
/**
* Get justNumber
* @return justNumber
**/
@ApiModelProperty(example = "null", value = "")
public BigDecimal getJustNumber() {
return justNumber;
}
public void setJustNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NumberOnly numberOnly = (NumberOnly) o;
return Objects.equals(this.justNumber, numberOnly.justNumber);
}
@Override
public int hashCode() {
return Objects.hash(justNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NumberOnly {\n");
sb.append(" justNumber: ").append(toIndentedString(justNumber)).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 ");
}
}

View File

@ -26,25 +26,29 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import com.google.gson.annotations.SerializedName;
/** /**
* Order * Order
*/ */
public class Order { public class Order {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@SerializedName("petId") @SerializedName("petId")
private Long petId = null; private Long petId = null;
@SerializedName("quantity") @SerializedName("quantity")
private Integer quantity = null; private Integer quantity = null;
@SerializedName("shipDate") @SerializedName("shipDate")
private DateTime shipDate = null; private DateTime shipDate = null;
/** /**
* Order Status * Order Status
*/ */
@ -72,120 +76,121 @@ public class Order {
@SerializedName("status") @SerializedName("status")
private StatusEnum status = null; private StatusEnum status = null;
@SerializedName("complete") @SerializedName("complete")
private Boolean complete = false; private Boolean complete = false;
public Order id(Long id) {
this.id = id;
return this;
}
/** /**
* Get id * Get id
* @return id * @return id
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
/**
* Set id
*
* @param id id
*/
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/** /**
* Get petId * Get petId
* @return petId * @return petId
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getPetId() { public Long getPetId() {
return petId; return petId;
} }
/**
* Set petId
*
* @param petId petId
*/
public void setPetId(Long petId) { public void setPetId(Long petId) {
this.petId = petId; this.petId = petId;
} }
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/** /**
* Get quantity * Get quantity
* @return quantity * @return quantity
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Integer getQuantity() { public Integer getQuantity() {
return quantity; return quantity;
} }
/**
* Set quantity
*
* @param quantity quantity
*/
public void setQuantity(Integer quantity) { public void setQuantity(Integer quantity) {
this.quantity = quantity; this.quantity = quantity;
} }
public Order shipDate(DateTime shipDate) {
this.shipDate = shipDate;
return this;
}
/** /**
* Get shipDate * Get shipDate
* @return shipDate * @return shipDate
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public DateTime getShipDate() { public DateTime getShipDate() {
return shipDate; return shipDate;
} }
/**
* Set shipDate
*
* @param shipDate shipDate
*/
public void setShipDate(DateTime shipDate) { public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate; this.shipDate = shipDate;
} }
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/** /**
* Order Status * Order Status
* @return status * @return status
**/ **/
@ApiModelProperty(value = "Order Status") @ApiModelProperty(example = "null", value = "Order Status")
public StatusEnum getStatus() { public StatusEnum getStatus() {
return status; return status;
} }
/**
* Set status
*
* @param status status
*/
public void setStatus(StatusEnum status) { public void setStatus(StatusEnum status) {
this.status = status; this.status = status;
} }
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
/** /**
* Get complete * Get complete
* @return complete * @return complete
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Boolean getComplete() { public Boolean getComplete() {
return complete; return complete;
} }
/**
* Set complete
*
* @param complete complete
*/
public void setComplete(Boolean complete) { public void setComplete(Boolean complete) {
this.complete = complete; this.complete = complete;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -224,10 +229,8 @@ public class Order {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,6 +26,7 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Category; import io.swagger.client.model.Category;
@ -33,23 +34,27 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.gson.annotations.SerializedName;
/** /**
* Pet * Pet
*/ */
public class Pet { public class Pet {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@SerializedName("category") @SerializedName("category")
private Category category = null; private Category category = null;
@SerializedName("name") @SerializedName("name")
private String name = null; private String name = null;
@SerializedName("photoUrls") @SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>(); private List<String> photoUrls = new ArrayList<String>();
@SerializedName("tags") @SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>(); private List<Tag> tags = new ArrayList<Tag>();
/** /**
* pet status in the store * pet status in the store
*/ */
@ -78,117 +83,117 @@ public class Pet {
@SerializedName("status") @SerializedName("status")
private StatusEnum status = null; private StatusEnum status = null;
public Pet id(Long id) {
this.id = id;
return this;
}
/** /**
* Get id * Get id
* @return id * @return id
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
/**
* Set id
*
* @param id id
*/
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Pet category(Category category) {
this.category = category;
return this;
}
/** /**
* Get category * Get category
* @return category * @return category
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Category getCategory() { public Category getCategory() {
return category; return category;
} }
/**
* Set category
*
* @param category category
*/
public void setCategory(Category category) { public void setCategory(Category category) {
this.category = category; this.category = category;
} }
public Pet name(String name) {
this.name = name;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "doggie", required = true, value = "")
public String getName() { public String getName() {
return name; return name;
} }
/**
* Set name
*
* @param name name
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
/** /**
* Get photoUrls * Get photoUrls
* @return photoUrls * @return photoUrls
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(example = "null", required = true, value = "")
public List<String> getPhotoUrls() { public List<String> getPhotoUrls() {
return photoUrls; return photoUrls;
} }
/**
* Set photoUrls
*
* @param photoUrls photoUrls
*/
public void setPhotoUrls(List<String> photoUrls) { public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls; this.photoUrls = photoUrls;
} }
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
/** /**
* Get tags * Get tags
* @return tags * @return tags
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public List<Tag> getTags() { public List<Tag> getTags() {
return tags; return tags;
} }
/**
* Set tags
*
* @param tags tags
*/
public void setTags(List<Tag> tags) { public void setTags(List<Tag> tags) {
this.tags = tags; this.tags = tags;
} }
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/** /**
* pet status in the store * pet status in the store
* @return status * @return status
**/ **/
@ApiModelProperty(value = "pet status in the store") @ApiModelProperty(example = "null", value = "pet status in the store")
public StatusEnum getStatus() { public StatusEnum getStatus() {
return status; return status;
} }
/**
* Set status
*
* @param status status
*/
public void setStatus(StatusEnum status) { public void setStatus(StatusEnum status) {
this.status = status; this.status = status;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -227,10 +232,8 @@ public class Pet {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,18 +26,19 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* ReadOnlyFirst * ReadOnlyFirst
*/ */
public class ReadOnlyFirst { public class ReadOnlyFirst {
@SerializedName("bar") @SerializedName("bar")
private String bar = null; private String bar = null;
@SerializedName("baz") @SerializedName("baz")
private String baz = null; private String baz = null;
@ -45,32 +46,32 @@ public class ReadOnlyFirst {
* Get bar * Get bar
* @return bar * @return bar
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getBar() { public String getBar() {
return bar; return bar;
} }
public ReadOnlyFirst baz(String baz) {
this.baz = baz;
return this;
}
/** /**
* Get baz * Get baz
* @return baz * @return baz
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getBaz() { public String getBaz() {
return baz; return baz;
} }
/**
* Set baz
*
* @param baz baz
*/
public void setBaz(String baz) { public void setBaz(String baz) {
this.baz = baz; this.baz = baz;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -101,10 +102,8 @@ public class ReadOnlyFirst {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,40 +26,40 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* SpecialModelName * SpecialModelName
*/ */
public class SpecialModelName { public class SpecialModelName {
@SerializedName("$special[property.name]") @SerializedName("$special[property.name]")
private Long specialPropertyName = null; private Long specialPropertyName = null;
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
return this;
}
/** /**
* Get specialPropertyName * Get specialPropertyName
* @return specialPropertyName * @return specialPropertyName
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getSpecialPropertyName() { public Long getSpecialPropertyName() {
return specialPropertyName; return specialPropertyName;
} }
/**
* Set specialPropertyName
*
* @param specialPropertyName specialPropertyName
*/
public void setSpecialPropertyName(Long specialPropertyName) { public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName; this.specialPropertyName = specialPropertyName;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -88,10 +88,8 @@ public class SpecialModelName {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,60 +26,61 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* Tag * Tag
*/ */
public class Tag { public class Tag {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@SerializedName("name") @SerializedName("name")
private String name = null; private String name = null;
public Tag id(Long id) {
this.id = id;
return this;
}
/** /**
* Get id * Get id
* @return id * @return id
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
/**
* Set id
*
* @param id id
*/
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Tag name(String name) {
this.name = name;
return this;
}
/** /**
* Get name * Get name
* @return name * @return name
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getName() { public String getName() {
return name; return name;
} }
/**
* Set name
*
* @param name name
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -110,10 +111,8 @@ public class Tag {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }

View File

@ -26,180 +26,187 @@
package io.swagger.client.model; package io.swagger.client.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.google.gson.annotations.SerializedName;
/** /**
* User * User
*/ */
public class User { public class User {
@SerializedName("id") @SerializedName("id")
private Long id = null; private Long id = null;
@SerializedName("username") @SerializedName("username")
private String username = null; private String username = null;
@SerializedName("firstName") @SerializedName("firstName")
private String firstName = null; private String firstName = null;
@SerializedName("lastName") @SerializedName("lastName")
private String lastName = null; private String lastName = null;
@SerializedName("email") @SerializedName("email")
private String email = null; private String email = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
@SerializedName("phone") @SerializedName("phone")
private String phone = null; private String phone = null;
@SerializedName("userStatus") @SerializedName("userStatus")
private Integer userStatus = null; private Integer userStatus = null;
public User id(Long id) {
this.id = id;
return this;
}
/** /**
* Get id * Get id
* @return id * @return id
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
/**
* Set id
*
* @param id id
*/
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public User username(String username) {
this.username = username;
return this;
}
/** /**
* Get username * Get username
* @return username * @return username
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getUsername() { public String getUsername() {
return username; return username;
} }
/**
* Set username
*
* @param username username
*/
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/** /**
* Get firstName * Get firstName
* @return firstName * @return firstName
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getFirstName() { public String getFirstName() {
return firstName; return firstName;
} }
/**
* Set firstName
*
* @param firstName firstName
*/
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
this.firstName = firstName; this.firstName = firstName;
} }
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/** /**
* Get lastName * Get lastName
* @return lastName * @return lastName
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getLastName() { public String getLastName() {
return lastName; return lastName;
} }
/**
* Set lastName
*
* @param lastName lastName
*/
public void setLastName(String lastName) { public void setLastName(String lastName) {
this.lastName = lastName; this.lastName = lastName;
} }
public User email(String email) {
this.email = email;
return this;
}
/** /**
* Get email * Get email
* @return email * @return email
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getEmail() { public String getEmail() {
return email; return email;
} }
/**
* Set email
*
* @param email email
*/
public void setEmail(String email) { public void setEmail(String email) {
this.email = email; this.email = email;
} }
public User password(String password) {
this.password = password;
return this;
}
/** /**
* Get password * Get password
* @return password * @return password
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getPassword() { public String getPassword() {
return password; return password;
} }
/**
* Set password
*
* @param password password
*/
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
public User phone(String phone) {
this.phone = phone;
return this;
}
/** /**
* Get phone * Get phone
* @return phone * @return phone
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(example = "null", value = "")
public String getPhone() { public String getPhone() {
return phone; return phone;
} }
/**
* Set phone
*
* @param phone phone
*/
public void setPhone(String phone) { public void setPhone(String phone) {
this.phone = phone; this.phone = phone;
} }
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
/** /**
* User Status * User Status
* @return userStatus * @return userStatus
**/ **/
@ApiModelProperty(value = "User Status") @ApiModelProperty(example = "null", value = "User Status")
public Integer getUserStatus() { public Integer getUserStatus() {
return userStatus; return userStatus;
} }
/**
* Set userStatus
*
* @param userStatus userStatus
*/
public void setUserStatus(Integer userStatus) { public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus; this.userStatus = userStatus;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
@ -242,10 +249,8 @@ public class User {
/** /**
* Convert the given object to string with each line indented by 4 spaces * Convert the given object to string with each line indented by 4 spaces
* (except the first line). * (except the first line).
*
* @param o Object to be converted to indented string
*/ */
private String toIndentedString(Object o) { private String toIndentedString(java.lang.Object o) {
if (o == null) { if (o == null) {
return "null"; return "null";
} }