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

View File

@ -833,4 +833,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public void setDateLibrary(String 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) {
this.useRxJava = useRxJava;
}
}

View File

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

View File

@ -51,7 +51,7 @@ import {{invokerPackage}}.auth.OAuth;
{{>generatedAnnotation}}
public class ApiClient {
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private String basePath = "{{basePath}}";
private String basePath = "{{{basePath}}}";
private boolean debugging = false;
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";
private String basePath = "{{basePath}}";
private String basePath = "{{{basePath}}}";
private boolean lenientOnJson = false;
private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
@ -169,7 +169,7 @@ public class ApiClient {
/**
* 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
*/
public ApiClient setBasePath(String basePath) {

View File

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

View File

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

View File

@ -1,7 +1,7 @@
/**
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
*/
public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {
public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#gson}}
{{#allowableValues}}{{#enumVars}}
@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}}
{{/gson}}
private {{dataType}} value;
private {{{dataType}}} value;
{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) {
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
this.value = value;
}

View File

@ -6,11 +6,15 @@
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
{{#vars}}
{{#isEnum}}
{{^isContainer}}
{{>modelInnerEnum}}
{{/isContainer}}
{{/isEnum}}
{{#items.isEnum}}
{{#items}}
{{^isContainer}}
{{>modelInnerEnum}}
{{/isContainer}}
{{/items}}
{{/items.isEnum}}
{{#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]
**arrayArrayOfInteger** | [**List&lt;List&lt;Long&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
------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection &#x3D;end
[**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>
# **testEndpointParameters**
> 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
- **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).
authentications = new HashMap<String, Authentication>();
authentications.put("petstore_auth", new OAuth());
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("petstore_auth", new OAuth());
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
@ -191,7 +191,7 @@ public class ApiClient {
/**
* 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
*/
public ApiClient setBasePath(String basePath) {

View File

@ -39,8 +39,8 @@ import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import org.joda.time.LocalDate;
import java.math.BigDecimal;
import org.joda.time.DateTime;
import java.math.BigDecimal;
import java.lang.reflect.Type;
import java.util.ArrayList;
@ -67,6 +67,105 @@ public class FakeApi {
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 */
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;
@ -241,4 +340,113 @@ public class FakeApi {
apiClient.executeAsync(call, callback);
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 io.swagger.client.model.Pet;
import io.swagger.client.model.ModelApiResponse;
import java.io.File;
import io.swagger.client.model.ModelApiResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;

View File

@ -26,101 +26,100 @@
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;
import com.google.gson.annotations.SerializedName;
/**
* AdditionalPropertiesClass
*/
public class AdditionalPropertiesClass {
@SerializedName("map_property")
private Map<String, String> mapProperty = new HashMap<String, String>();
@SerializedName("map_of_map_property")
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
@SerializedName("map_property")
private Map<String, String> mapProperty = new HashMap<String, String>();
/**
* Get mapProperty
* @return mapProperty
**/
@ApiModelProperty(value = "")
public Map<String, String> getMapProperty() {
return mapProperty;
@SerializedName("map_of_map_property")
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
* @return mapProperty
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, String> getMapProperty() {
return mapProperty;
}
public void setMapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
}
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
return this;
}
/**
* Get mapOfMapProperty
* @return mapOfMapProperty
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty;
}
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set mapProperty
*
* @param mapProperty mapProperty
*/
public void setMapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get mapOfMapProperty
* @return mapOfMapProperty
**/
@ApiModelProperty(value = "")
public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty;
}
/**
* Set mapOfMapProperty
*
* @param mapOfMapProperty mapOfMapProperty
*/
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
}
}
@Override
public int hashCode() {
return Objects.hash(mapProperty, mapOfMapProperty);
}
@Override
public int hashCode() {
return Objects.hash(mapProperty, mapOfMapProperty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,98 +26,97 @@
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 com.google.gson.annotations.SerializedName;
/**
* Animal
*/
public class Animal {
@SerializedName("className")
private String className = null;
@SerializedName("color")
private String color = "red";
@SerializedName("className")
private String className = null;
/**
* Get className
* @return className
**/
@ApiModelProperty(required = true, value = "")
public String getClassName() {
return className;
@SerializedName("color")
private String color = "red";
public Animal className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
**/
@ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Animal color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(example = "null", value = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) {
this.className = className;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
/**
* Set color
*
* @param color color
*/
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Objects.equals(this.color, animal.color);
}
}
@Override
public int hashCode() {
return Objects.hash(className, color);
}
@Override
public int hashCode() {
return Objects.hash(className, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Animal {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Animal {\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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

@ -30,51 +30,47 @@ import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
/**
* AnimalFarm
*/
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

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,122 +26,168 @@
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 io.swagger.client.model.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
/**
* ArrayTest
*/
public class ArrayTest {
@SerializedName("array_of_string")
private List<String> arrayOfString = new ArrayList<String>();
@SerializedName("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
@SerializedName("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
@SerializedName("array_of_string")
private List<String> arrayOfString = new ArrayList<String>();
/**
* Get arrayOfString
* @return arrayOfString
**/
@ApiModelProperty(value = "")
public List<String> getArrayOfString() {
return arrayOfString;
}
@SerializedName("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
/**
* Set arrayOfString
*
* @param arrayOfString arrayOfString
*/
public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
}
@SerializedName("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
/**
* Get arrayArrayOfInteger
* @return arrayArrayOfInteger
**/
@ApiModelProperty(value = "")
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
/**
* Gets or Sets arrayOfEnum
*/
public enum ArrayOfEnumEnum {
@SerializedName("UPPER")
UPPER("UPPER"),
/**
* Set arrayArrayOfInteger
*
* @param arrayArrayOfInteger arrayArrayOfInteger
*/
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
@SerializedName("lower")
LOWER("lower");
/**
* Get arrayArrayOfModel
* @return arrayArrayOfModel
**/
@ApiModelProperty(value = "")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
private String value;
/**
* Set arrayArrayOfModel
*
* @param arrayArrayOfModel arrayArrayOfModel
*/
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
}
@Override
public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
ArrayOfEnumEnum(String value) {
this.value = value;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayTest {\n");
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
sb.append("}");
return sb.toString();
return String.valueOf(value);
}
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
@SerializedName("array_of_enum")
private List<ArrayOfEnumEnum> arrayOfEnum = new ArrayList<ArrayOfEnumEnum>();
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
/**
* Get arrayOfString
* @return arrayOfString
**/
@ApiModelProperty(example = "null", value = "")
public List<String> getArrayOfString() {
return arrayOfString;
}
public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
}
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
/**
* Get arrayArrayOfInteger
* @return arrayArrayOfInteger
**/
@ApiModelProperty(example = "null", value = "")
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
/**
* Get arrayArrayOfModel
* @return arrayArrayOfModel
**/
@ApiModelProperty(example = "null", value = "")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> 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
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel) &&
Objects.equals(this.arrayOfEnum, arrayTest.arrayOfEnum);
}
@Override
public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel, arrayOfEnum);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayTest {\n");
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
sb.append(" arrayOfEnum: ").append(toIndentedString(arrayOfEnum)).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,122 +26,122 @@
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 io.swagger.client.model.Animal;
import com.google.gson.annotations.SerializedName;
/**
* Cat
*/
public class Cat extends Animal {
@SerializedName("className")
private String className = null;
@SerializedName("color")
private String color = "red";
@SerializedName("declawed")
private Boolean declawed = null;
@SerializedName("className")
private String className = null;
/**
* Get className
* @return className
**/
@ApiModelProperty(required = true, value = "")
public String getClassName() {
return className;
@SerializedName("color")
private String color = "red";
@SerializedName("declawed")
private Boolean declawed = null;
public Cat className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
**/
@ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Cat color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(example = "null", value = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
/**
* Get declawed
* @return declawed
**/
@ApiModelProperty(example = "null", value = "")
public Boolean getDeclawed() {
return declawed;
}
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) {
this.className = className;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
/**
* Set color
*
* @param color color
*/
public void setColor(String color) {
this.color = color;
}
/**
* Get declawed
* @return declawed
**/
@ApiModelProperty(value = "")
public Boolean getDeclawed() {
return declawed;
}
/**
* Set declawed
*
* @param declawed declawed
*/
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Cat cat = (Cat) o;
return Objects.equals(this.className, cat.className) &&
Cat cat = (Cat) o;
return Objects.equals(this.className, cat.className) &&
Objects.equals(this.color, cat.color) &&
Objects.equals(this.declawed, cat.declawed) &&
super.equals(o);
}
}
@Override
public int hashCode() {
return Objects.hash(className, color, declawed, super.hashCode());
}
@Override
public int hashCode() {
return Objects.hash(className, color, declawed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Cat {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
sb.append("}");
return sb.toString();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Cat {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,98 +26,97 @@
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 com.google.gson.annotations.SerializedName;
/**
* Category
*/
public class Category {
@SerializedName("id")
private Long id = null;
@SerializedName("name")
private String name = null;
@SerializedName("id")
private Long id = null;
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
@SerializedName("name")
private String name = null;
public Category id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Category name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(example = "null", value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set id
*
* @param id id
*/
public void setId(Long id) {
this.id = id;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
/**
* Set name
*
* @param name name
*/
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,122 +26,122 @@
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 io.swagger.client.model.Animal;
import com.google.gson.annotations.SerializedName;
/**
* Dog
*/
public class Dog extends Animal {
@SerializedName("className")
private String className = null;
@SerializedName("color")
private String color = "red";
@SerializedName("breed")
private String breed = null;
@SerializedName("className")
private String className = null;
/**
* Get className
* @return className
**/
@ApiModelProperty(required = true, value = "")
public String getClassName() {
return className;
@SerializedName("color")
private String color = "red";
@SerializedName("breed")
private String breed = null;
public Dog className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
**/
@ApiModelProperty(example = "null", required = true, value = "")
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Dog color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(example = "null", value = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Dog breed(String breed) {
this.breed = breed;
return this;
}
/**
* Get breed
* @return breed
**/
@ApiModelProperty(example = "null", value = "")
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set className
*
* @param className className
*/
public void setClassName(String className) {
this.className = className;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get color
* @return color
**/
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
/**
* Set color
*
* @param color color
*/
public void setColor(String color) {
this.color = color;
}
/**
* Get breed
* @return breed
**/
@ApiModelProperty(value = "")
public String getBreed() {
return breed;
}
/**
* Set breed
*
* @param breed breed
*/
public void setBreed(String breed) {
this.breed = breed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Dog dog = (Dog) o;
return Objects.equals(this.className, dog.className) &&
Dog dog = (Dog) o;
return Objects.equals(this.className, dog.className) &&
Objects.equals(this.color, dog.color) &&
Objects.equals(this.breed, dog.breed) &&
super.equals(o);
}
}
@Override
public int hashCode() {
return Objects.hash(className, color, breed, super.hashCode());
}
@Override
public int hashCode() {
return Objects.hash(className, color, breed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Dog {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
sb.append("}");
return sb.toString();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Dog {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,7 +26,6 @@
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
@ -34,24 +33,25 @@ import com.google.gson.annotations.SerializedName;
* Gets or Sets EnumClass
*/
public enum EnumClass {
@SerializedName("_abc")
_ABC("_abc"),
@SerializedName("-efg")
_EFG("-efg"),
@SerializedName("_abc")
_ABC("_abc"),
@SerializedName("(xyz)")
_XYZ_("(xyz)");
@SerializedName("-efg")
_EFG("-efg"),
private String value;
@SerializedName("(xyz)")
_XYZ_("(xyz)");
EnumClass(String value) {
this.value = value;
}
private String value;
@Override
public String toString() {
return String.valueOf(value);
}
EnumClass(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}

View File

@ -26,15 +26,15 @@
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 com.google.gson.annotations.SerializedName;
/**
* EnumTest
*/
public class EnumTest {
/**
* Gets or Sets enumString
@ -58,8 +58,9 @@ public class EnumTest {
}
}
@SerializedName("enum_string")
private EnumStringEnum enumString = null;
@SerializedName("enum_string")
private EnumStringEnum enumString = null;
/**
* Gets or Sets enumInteger
*/
@ -82,8 +83,9 @@ public class EnumTest {
}
}
@SerializedName("enum_integer")
private EnumIntegerEnum enumInteger = null;
@SerializedName("enum_integer")
private EnumIntegerEnum enumInteger = null;
/**
* Gets or Sets enumNumber
*/
@ -106,106 +108,104 @@ public class EnumTest {
}
}
@SerializedName("enum_number")
private EnumNumberEnum enumNumber = null;
@SerializedName("enum_number")
private EnumNumberEnum enumNumber = null;
/**
* Get enumString
* @return enumString
**/
@ApiModelProperty(value = "")
public EnumStringEnum getEnumString() {
return enumString;
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
}
/**
* Get enumString
* @return enumString
**/
@ApiModelProperty(example = "null", value = "")
public EnumStringEnum getEnumString() {
return enumString;
}
public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString;
}
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
}
/**
* Get enumInteger
* @return enumInteger
**/
@ApiModelProperty(example = "null", value = "")
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
}
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return this;
}
/**
* Get enumNumber
* @return enumNumber
**/
@ApiModelProperty(example = "null", value = "")
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set enumString
*
* @param enumString enumString
*/
public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get enumInteger
* @return enumInteger
**/
@ApiModelProperty(value = "")
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
/**
* Set enumInteger
*
* @param enumInteger enumInteger
*/
public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
}
/**
* Get enumNumber
* @return enumNumber
**/
@ApiModelProperty(value = "")
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
/**
* Set enumNumber
*
* @param enumNumber enumNumber
*/
public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnumTest enumTest = (EnumTest) o;
return Objects.equals(this.enumString, enumTest.enumString) &&
EnumTest enumTest = (EnumTest) o;
return Objects.equals(this.enumString, enumTest.enumString) &&
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
Objects.equals(this.enumNumber, enumTest.enumNumber);
}
}
@Override
public int hashCode() {
return Objects.hash(enumString, enumInteger, enumNumber);
}
@Override
public int hashCode() {
return Objects.hash(enumString, enumInteger, enumNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumTest {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumTest {\n");
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,301 +26,313 @@
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 org.joda.time.DateTime;
import org.joda.time.LocalDate;
import com.google.gson.annotations.SerializedName;
/**
* FormatTest
*/
public class FormatTest {
@SerializedName("integer")
private Integer integer = null;
@SerializedName("int32")
private Integer int32 = null;
@SerializedName("int64")
private Long int64 = null;
@SerializedName("number")
private BigDecimal number = null;
@SerializedName("float")
private Float _float = null;
@SerializedName("double")
private Double _double = null;
@SerializedName("string")
private String string = null;
@SerializedName("byte")
private byte[] _byte = null;
@SerializedName("binary")
private byte[] binary = null;
@SerializedName("date")
private LocalDate date = null;
@SerializedName("dateTime")
private DateTime dateTime = null;
@SerializedName("uuid")
private String uuid = null;
@SerializedName("password")
private String password = null;
@SerializedName("integer")
private Integer integer = null;
/**
* Get integer
* minimum: 10.0
* maximum: 100.0
* @return integer
**/
@ApiModelProperty(value = "")
public Integer getInteger() {
return integer;
@SerializedName("int32")
private Integer int32 = null;
@SerializedName("int64")
private Long int64 = null;
@SerializedName("number")
private BigDecimal number = null;
@SerializedName("float")
private Float _float = null;
@SerializedName("double")
private Double _double = null;
@SerializedName("string")
private String string = null;
@SerializedName("byte")
private byte[] _byte = null;
@SerializedName("binary")
private byte[] binary = null;
@SerializedName("date")
private LocalDate date = null;
@SerializedName("dateTime")
private DateTime dateTime = null;
@SerializedName("uuid")
private String uuid = null;
@SerializedName("password")
private String password = null;
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
/**
* Get integer
* minimum: 10.0
* maximum: 100.0
* @return integer
**/
@ApiModelProperty(example = "null", value = "")
public Integer getInteger() {
return integer;
}
public void setInteger(Integer integer) {
this.integer = integer;
}
public FormatTest int32(Integer int32) {
this.int32 = int32;
return this;
}
/**
* Get int32
* minimum: 20.0
* maximum: 200.0
* @return int32
**/
@ApiModelProperty(example = "null", value = "")
public Integer getInt32() {
return int32;
}
public void setInt32(Integer int32) {
this.int32 = int32;
}
public FormatTest int64(Long int64) {
this.int64 = int64;
return this;
}
/**
* Get int64
* @return int64
**/
@ApiModelProperty(example = "null", value = "")
public Long getInt64() {
return int64;
}
public void setInt64(Long int64) {
this.int64 = int64;
}
public FormatTest number(BigDecimal number) {
this.number = number;
return this;
}
/**
* Get number
* minimum: 32.1
* maximum: 543.2
* @return number
**/
@ApiModelProperty(example = "null", required = true, value = "")
public BigDecimal getNumber() {
return number;
}
public void setNumber(BigDecimal number) {
this.number = number;
}
public FormatTest _float(Float _float) {
this._float = _float;
return this;
}
/**
* Get _float
* minimum: 54.3
* maximum: 987.6
* @return _float
**/
@ApiModelProperty(example = "null", value = "")
public Float getFloat() {
return _float;
}
public void setFloat(Float _float) {
this._float = _float;
}
public FormatTest _double(Double _double) {
this._double = _double;
return this;
}
/**
* Get _double
* minimum: 67.8
* maximum: 123.4
* @return _double
**/
@ApiModelProperty(example = "null", value = "")
public Double getDouble() {
return _double;
}
public void setDouble(Double _double) {
this._double = _double;
}
public FormatTest string(String string) {
this.string = string;
return this;
}
/**
* Get string
* @return string
**/
@ApiModelProperty(example = "null", value = "")
public String getString() {
return string;
}
public void setString(String string) {
this.string = string;
}
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
/**
* Get _byte
* @return _byte
**/
@ApiModelProperty(example = "null", required = true, value = "")
public byte[] getByte() {
return _byte;
}
public void setByte(byte[] _byte) {
this._byte = _byte;
}
public FormatTest binary(byte[] binary) {
this.binary = binary;
return this;
}
/**
* Get binary
* @return binary
**/
@ApiModelProperty(example = "null", value = "")
public byte[] getBinary() {
return binary;
}
public void setBinary(byte[] binary) {
this.binary = binary;
}
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
/**
* Get date
* @return date
**/
@ApiModelProperty(example = "null", required = true, value = "")
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public FormatTest dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
/**
* Get dateTime
* @return dateTime
**/
@ApiModelProperty(example = "null", value = "")
public DateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
public FormatTest uuid(String uuid) {
this.uuid = uuid;
return this;
}
/**
* Get uuid
* @return uuid
**/
@ApiModelProperty(example = "null", value = "")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public FormatTest password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@ApiModelProperty(example = "null", required = true, value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set integer
*
* @param integer integer
*/
public void setInteger(Integer integer) {
this.integer = integer;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get int32
* minimum: 20.0
* maximum: 200.0
* @return int32
**/
@ApiModelProperty(value = "")
public Integer getInt32() {
return int32;
}
/**
* Set int32
*
* @param int32 int32
*/
public void setInt32(Integer int32) {
this.int32 = int32;
}
/**
* Get int64
* @return int64
**/
@ApiModelProperty(value = "")
public Long getInt64() {
return int64;
}
/**
* Set int64
*
* @param int64 int64
*/
public void setInt64(Long int64) {
this.int64 = int64;
}
/**
* Get number
* minimum: 32.1
* maximum: 543.2
* @return number
**/
@ApiModelProperty(required = true, value = "")
public BigDecimal getNumber() {
return number;
}
/**
* Set number
*
* @param number number
*/
public void setNumber(BigDecimal number) {
this.number = number;
}
/**
* Get _float
* minimum: 54.3
* maximum: 987.6
* @return _float
**/
@ApiModelProperty(value = "")
public Float getFloat() {
return _float;
}
/**
* Set _float
*
* @param _float _float
*/
public void setFloat(Float _float) {
this._float = _float;
}
/**
* Get _double
* minimum: 67.8
* maximum: 123.4
* @return _double
**/
@ApiModelProperty(value = "")
public Double getDouble() {
return _double;
}
/**
* Set _double
*
* @param _double _double
*/
public void setDouble(Double _double) {
this._double = _double;
}
/**
* Get string
* @return string
**/
@ApiModelProperty(value = "")
public String getString() {
return string;
}
/**
* Set string
*
* @param string string
*/
public void setString(String string) {
this.string = string;
}
/**
* Get _byte
* @return _byte
**/
@ApiModelProperty(required = true, value = "")
public byte[] getByte() {
return _byte;
}
/**
* Set _byte
*
* @param _byte _byte
*/
public void setByte(byte[] _byte) {
this._byte = _byte;
}
/**
* Get binary
* @return binary
**/
@ApiModelProperty(value = "")
public byte[] getBinary() {
return binary;
}
/**
* Set binary
*
* @param binary binary
*/
public void setBinary(byte[] binary) {
this.binary = binary;
}
/**
* Get date
* @return date
**/
@ApiModelProperty(required = true, value = "")
public LocalDate getDate() {
return date;
}
/**
* Set date
*
* @param date date
*/
public void setDate(LocalDate date) {
this.date = date;
}
/**
* Get dateTime
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
return dateTime;
}
/**
* Set dateTime
*
* @param dateTime dateTime
*/
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
/**
* Get uuid
* @return uuid
**/
@ApiModelProperty(value = "")
public String getUuid() {
return uuid;
}
/**
* Set uuid
*
* @param uuid uuid
*/
public void setUuid(String uuid) {
this.uuid = uuid;
}
/**
* Get password
* @return password
**/
@ApiModelProperty(required = true, value = "")
public String getPassword() {
return password;
}
/**
* Set password
*
* @param password password
*/
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FormatTest formatTest = (FormatTest) o;
return Objects.equals(this.integer, formatTest.integer) &&
FormatTest formatTest = (FormatTest) o;
return Objects.equals(this.integer, formatTest.integer) &&
Objects.equals(this.int32, formatTest.int32) &&
Objects.equals(this.int64, formatTest.int64) &&
Objects.equals(this.number, formatTest.number) &&
@ -333,46 +345,44 @@ public class FormatTest {
Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password);
}
}
@Override
public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
}
@Override
public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FormatTest {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FormatTest {\n");
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" string: ").append(toIndentedString(string)).append("\n");
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" string: ").append(toIndentedString(string)).append("\n");
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,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;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
@ -34,117 +35,116 @@ import java.util.List;
import java.util.Map;
import org.joda.time.DateTime;
import com.google.gson.annotations.SerializedName;
/**
* MixedPropertiesAndAdditionalPropertiesClass
*/
public class MixedPropertiesAndAdditionalPropertiesClass {
@SerializedName("uuid")
private String uuid = null;
@SerializedName("dateTime")
private DateTime dateTime = null;
@SerializedName("map")
private Map<String, Animal> map = new HashMap<String, Animal>();
@SerializedName("uuid")
private String uuid = null;
/**
* Get uuid
* @return uuid
**/
@ApiModelProperty(value = "")
public String getUuid() {
return uuid;
@SerializedName("dateTime")
private DateTime dateTime = null;
@SerializedName("map")
private Map<String, Animal> map = new HashMap<String, Animal>();
public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) {
this.uuid = uuid;
return this;
}
/**
* Get uuid
* @return uuid
**/
@ApiModelProperty(example = "null", value = "")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
/**
* Get dateTime
* @return dateTime
**/
@ApiModelProperty(example = "null", value = "")
public DateTime getDateTime() {
return dateTime;
}
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;
return this;
}
/**
* Get map
* @return map
**/
@ApiModelProperty(example = "null", value = "")
public Map<String, Animal> getMap() {
return map;
}
public void setMap(Map<String, Animal> map) {
this.map = map;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set uuid
*
* @param uuid uuid
*/
public void setUuid(String uuid) {
this.uuid = uuid;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get dateTime
* @return dateTime
**/
@ApiModelProperty(value = "")
public DateTime getDateTime() {
return dateTime;
}
/**
* Set dateTime
*
* @param dateTime dateTime
*/
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
/**
* Get map
* @return map
**/
@ApiModelProperty(value = "")
public Map<String, Animal> getMap() {
return map;
}
/**
* Set map
*
* @param map map
*/
public void setMap(Map<String, Animal> map) {
this.map = map;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
}
@Override
public int hashCode() {
return Objects.hash(uuid, dateTime, map);
}
@Override
public int hashCode() {
return Objects.hash(uuid, dateTime, map);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" map: ").append(toIndentedString(map)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" map: ").append(toIndentedString(map)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,99 +26,98 @@
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 com.google.gson.annotations.SerializedName;
/**
* Model for testing model name starting with number
*/
@ApiModel(description = "Model for testing model name starting with number")
public class Model200Response {
@SerializedName("name")
private Integer name = null;
@SerializedName("class")
private String PropertyClass = null;
@SerializedName("name")
private Integer name = null;
/**
* Get name
* @return name
**/
@ApiModelProperty(value = "")
public Integer getName() {
return name;
@SerializedName("class")
private String PropertyClass = null;
public Model200Response name(Integer name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(example = "null", value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
public Model200Response PropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
return this;
}
/**
* Get PropertyClass
* @return PropertyClass
**/
@ApiModelProperty(example = "null", value = "")
public String getPropertyClass() {
return PropertyClass;
}
public void setPropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set name
*
* @param name name
*/
public void setName(Integer name) {
this.name = name;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get PropertyClass
* @return PropertyClass
**/
@ApiModelProperty(value = "")
public String getPropertyClass() {
return PropertyClass;
}
/**
* Set PropertyClass
*
* @param PropertyClass PropertyClass
*/
public void setPropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(this.name, _200Response.name) &&
Model200Response _200Response = (Model200Response) o;
return Objects.equals(this.name, _200Response.name) &&
Objects.equals(this.PropertyClass, _200Response.PropertyClass);
}
}
@Override
public int hashCode() {
return Objects.hash(name, PropertyClass);
}
@Override
public int hashCode() {
return Objects.hash(name, PropertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,120 +26,120 @@
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 com.google.gson.annotations.SerializedName;
/**
* ModelApiResponse
*/
public class ModelApiResponse {
@SerializedName("code")
private Integer code = null;
@SerializedName("type")
private String type = null;
@SerializedName("message")
private String message = null;
@SerializedName("code")
private Integer code = null;
/**
* Get code
* @return code
**/
@ApiModelProperty(value = "")
public Integer getCode() {
return code;
@SerializedName("type")
private String type = null;
@SerializedName("message")
private String message = null;
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/**
* Get code
* @return code
**/
@ApiModelProperty(example = "null", value = "")
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
**/
@ApiModelProperty(example = "null", value = "")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@ApiModelProperty(example = "null", value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set code
*
* @param code code
*/
public void setCode(Integer code) {
this.code = code;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get type
* @return type
**/
@ApiModelProperty(value = "")
public String getType() {
return type;
}
/**
* Set type
*
* @param type type
*/
public void setType(String type) {
this.type = type;
}
/**
* Get message
* @return message
**/
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
/**
* Set message
*
* @param message message
*/
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
}
}
@Override
public int hashCode() {
return Objects.hash(code, type, message);
}
@Override
public int hashCode() {
return Objects.hash(code, type, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,77 +26,75 @@
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 com.google.gson.annotations.SerializedName;
/**
* Model for testing reserved words
*/
@ApiModel(description = "Model for testing reserved words")
public class ModelReturn {
@SerializedName("return")
private Integer _return = null;
@SerializedName("return")
private Integer _return = null;
/**
* Get _return
* @return _return
**/
@ApiModelProperty(value = "")
public Integer getReturn() {
return _return;
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
/**
* Get _return
* @return _return
**/
@ApiModelProperty(example = "null", value = "")
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;
}
/**
* Set _return
*
* @param _return _return
*/
public void setReturn(Integer _return) {
this._return = _return;
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 boolean equals(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).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
@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

@ -26,125 +26,126 @@
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 com.google.gson.annotations.SerializedName;
/**
* Model for testing model name same as property name
*/
@ApiModel(description = "Model for testing model name same as property name")
public class Name {
@SerializedName("name")
private Integer name = null;
@SerializedName("snake_case")
private Integer snakeCase = null;
@SerializedName("property")
private String property = null;
@SerializedName("123Number")
private Integer _123Number = null;
@SerializedName("name")
private Integer name = null;
/**
* Get name
* @return name
**/
@ApiModelProperty(required = true, value = "")
public Integer getName() {
return name;
@SerializedName("snake_case")
private Integer snakeCase = null;
@SerializedName("property")
private String property = null;
@SerializedName("123Number")
private Integer _123Number = null;
public Name name(Integer name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(example = "null", required = true, value = "")
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
/**
* Get snakeCase
* @return snakeCase
**/
@ApiModelProperty(example = "null", value = "")
public Integer getSnakeCase() {
return snakeCase;
}
public Name property(String property) {
this.property = property;
return this;
}
/**
* Get property
* @return property
**/
@ApiModelProperty(example = "null", value = "")
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
/**
* Get _123Number
* @return _123Number
**/
@ApiModelProperty(example = "null", value = "")
public Integer get123Number() {
return _123Number;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set name
*
* @param name name
*/
public void setName(Integer name) {
this.name = name;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get snakeCase
* @return snakeCase
**/
@ApiModelProperty(value = "")
public Integer getSnakeCase() {
return snakeCase;
}
/**
* Get property
* @return property
**/
@ApiModelProperty(value = "")
public String getProperty() {
return property;
}
/**
* Set property
*
* @param property property
*/
public void setProperty(String property) {
this.property = property;
}
/**
* Get _123Number
* @return _123Number
**/
@ApiModelProperty(value = "")
public Integer get123Number() {
return _123Number;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(this.name, name.name) &&
Name name = (Name) o;
return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase) &&
Objects.equals(this.property, name.property) &&
Objects.equals(this._123Number, name._123Number);
}
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase, property, _123Number);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase, property, _123Number);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,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;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import com.google.gson.annotations.SerializedName;
/**
* Order
*/
public class Order {
@SerializedName("id")
private Long id = null;
@SerializedName("petId")
private Long petId = null;
@SerializedName("quantity")
private Integer quantity = null;
@SerializedName("shipDate")
private DateTime shipDate = null;
@SerializedName("id")
private Long id = null;
@SerializedName("petId")
private Long petId = null;
@SerializedName("quantity")
private Integer quantity = null;
@SerializedName("shipDate")
private DateTime shipDate = null;
/**
* Order Status
*/
@ -70,168 +74,167 @@ public class Order {
}
}
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("complete")
private Boolean complete = false;
@SerializedName("status")
private StatusEnum status = null;
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
@SerializedName("complete")
private Boolean complete = false;
public Order id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/**
* Get petId
* @return petId
**/
@ApiModelProperty(example = "null", value = "")
public Long getPetId() {
return petId;
}
public void setPetId(Long petId) {
this.petId = petId;
}
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/**
* Get quantity
* @return quantity
**/
@ApiModelProperty(example = "null", value = "")
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Order shipDate(DateTime shipDate) {
this.shipDate = shipDate;
return this;
}
/**
* Get shipDate
* @return shipDate
**/
@ApiModelProperty(example = "null", value = "")
public DateTime getShipDate() {
return shipDate;
}
public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate;
}
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Order Status
* @return status
**/
@ApiModelProperty(example = "null", value = "Order Status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
/**
* Get complete
* @return complete
**/
@ApiModelProperty(example = "null", value = "")
public Boolean getComplete() {
return complete;
}
public void setComplete(Boolean complete) {
this.complete = complete;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set id
*
* @param id id
*/
public void setId(Long id) {
this.id = id;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get petId
* @return petId
**/
@ApiModelProperty(value = "")
public Long getPetId() {
return petId;
}
/**
* Set petId
*
* @param petId petId
*/
public void setPetId(Long petId) {
this.petId = petId;
}
/**
* Get quantity
* @return quantity
**/
@ApiModelProperty(value = "")
public Integer getQuantity() {
return quantity;
}
/**
* Set quantity
*
* @param quantity quantity
*/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* Get shipDate
* @return shipDate
**/
@ApiModelProperty(value = "")
public DateTime getShipDate() {
return shipDate;
}
/**
* Set shipDate
*
* @param shipDate shipDate
*/
public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate;
}
/**
* Order Status
* @return status
**/
@ApiModelProperty(value = "Order Status")
public StatusEnum getStatus() {
return status;
}
/**
* Set status
*
* @param status status
*/
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
* Get complete
* @return complete
**/
@ApiModelProperty(value = "")
public Boolean getComplete() {
return complete;
}
/**
* Set complete
*
* @param complete complete
*/
public void setComplete(Boolean complete) {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
}
}
@Override
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@Override
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Category;
@ -33,23 +34,27 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
/**
* Pet
*/
public class Pet {
@SerializedName("id")
private Long id = null;
@SerializedName("category")
private Category category = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
@SerializedName("id")
private Long id = null;
@SerializedName("category")
private Category category = null;
@SerializedName("name")
private String name = null;
@SerializedName("photoUrls")
private List<String> photoUrls = new ArrayList<String>();
@SerializedName("tags")
private List<Tag> tags = new ArrayList<Tag>();
/**
* pet status in the store
*/
@ -75,166 +80,164 @@ public class Pet {
}
}
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("status")
private StatusEnum status = null;
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
public Pet id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Pet category(Category category) {
this.category = category;
return this;
}
/**
* Get category
* @return category
**/
@ApiModelProperty(example = "null", value = "")
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public Pet name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(example = "doggie", required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
/**
* Get photoUrls
* @return photoUrls
**/
@ApiModelProperty(example = "null", required = true, value = "")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
/**
* Get tags
* @return tags
**/
@ApiModelProperty(example = "null", value = "")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/**
* pet status in the store
* @return status
**/
@ApiModelProperty(example = "null", value = "pet status in the store")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set id
*
* @param id id
*/
public void setId(Long id) {
this.id = id;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get category
* @return category
**/
@ApiModelProperty(value = "")
public Category getCategory() {
return category;
}
/**
* Set category
*
* @param category category
*/
public void setCategory(Category category) {
this.category = category;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
/**
* Set name
*
* @param name name
*/
public void setName(String name) {
this.name = name;
}
/**
* Get photoUrls
* @return photoUrls
**/
@ApiModelProperty(required = true, value = "")
public List<String> getPhotoUrls() {
return photoUrls;
}
/**
* Set photoUrls
*
* @param photoUrls photoUrls
*/
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
/**
* Get tags
* @return tags
**/
@ApiModelProperty(value = "")
public List<Tag> getTags() {
return tags;
}
/**
* Set tags
*
* @param tags tags
*/
public void setTags(List<Tag> tags) {
this.tags = tags;
}
/**
* pet status in the store
* @return status
**/
@ApiModelProperty(value = "pet status in the store")
public StatusEnum getStatus() {
return status;
}
/**
* Set status
*
* @param status status
*/
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
}
}
@Override
public int hashCode() {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@Override
public int hashCode() {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,89 +26,88 @@
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 com.google.gson.annotations.SerializedName;
/**
* ReadOnlyFirst
*/
public class ReadOnlyFirst {
@SerializedName("bar")
private String bar = null;
@SerializedName("baz")
private String baz = null;
@SerializedName("bar")
private String bar = null;
/**
* Get bar
* @return bar
**/
@ApiModelProperty(value = "")
public String getBar() {
return bar;
@SerializedName("baz")
private String baz = null;
/**
* Get bar
* @return bar
**/
@ApiModelProperty(example = "null", value = "")
public String getBar() {
return bar;
}
public ReadOnlyFirst baz(String baz) {
this.baz = baz;
return this;
}
/**
* Get baz
* @return baz
**/
@ApiModelProperty(example = "null", value = "")
public String getBaz() {
return baz;
}
public void setBaz(String baz) {
this.baz = baz;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Get baz
* @return baz
**/
@ApiModelProperty(value = "")
public String getBaz() {
return baz;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Set baz
*
* @param baz baz
*/
public void setBaz(String baz) {
this.baz = baz;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
return Objects.equals(this.bar, readOnlyFirst.bar) &&
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
return Objects.equals(this.bar, readOnlyFirst.bar) &&
Objects.equals(this.baz, readOnlyFirst.baz);
}
}
@Override
public int hashCode() {
return Objects.hash(bar, baz);
}
@Override
public int hashCode() {
return Objects.hash(bar, baz);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReadOnlyFirst {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReadOnlyFirst {\n");
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
sb.append(" baz: ").append(toIndentedString(baz)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
sb.append(" baz: ").append(toIndentedString(baz)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,76 +26,74 @@
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 com.google.gson.annotations.SerializedName;
/**
* SpecialModelName
*/
public class SpecialModelName {
@SerializedName("$special[property.name]")
private Long specialPropertyName = null;
@SerializedName("$special[property.name]")
private Long specialPropertyName = null;
/**
* Get specialPropertyName
* @return specialPropertyName
**/
@ApiModelProperty(value = "")
public Long getSpecialPropertyName() {
return specialPropertyName;
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
return this;
}
/**
* Get specialPropertyName
* @return specialPropertyName
**/
@ApiModelProperty(example = "null", value = "")
public Long getSpecialPropertyName() {
return specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set specialPropertyName
*
* @param specialPropertyName specialPropertyName
*/
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).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,98 +26,97 @@
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 com.google.gson.annotations.SerializedName;
/**
* Tag
*/
public class Tag {
@SerializedName("id")
private Long id = null;
@SerializedName("name")
private String name = null;
@SerializedName("id")
private Long id = null;
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
@SerializedName("name")
private String name = null;
public Tag id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Tag name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(example = "null", value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set id
*
* @param id id
*/
public void setId(Long id) {
this.id = id;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
/**
* Set name
*
* @param name name
*/
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
}
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Tag {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Tag {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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,188 +26,195 @@
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 com.google.gson.annotations.SerializedName;
/**
* User
*/
public class User {
@SerializedName("id")
private Long id = null;
@SerializedName("username")
private String username = null;
@SerializedName("firstName")
private String firstName = null;
@SerializedName("lastName")
private String lastName = null;
@SerializedName("email")
private String email = null;
@SerializedName("password")
private String password = null;
@SerializedName("phone")
private String phone = null;
@SerializedName("userStatus")
private Integer userStatus = null;
@SerializedName("id")
private Long id = null;
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
@SerializedName("username")
private String username = null;
@SerializedName("firstName")
private String firstName = null;
@SerializedName("lastName")
private String lastName = null;
@SerializedName("email")
private String email = null;
@SerializedName("password")
private String password = null;
@SerializedName("phone")
private String phone = null;
@SerializedName("userStatus")
private Integer userStatus = null;
public User id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User username(String username) {
this.username = username;
return this;
}
/**
* Get username
* @return username
**/
@ApiModelProperty(example = "null", value = "")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
**/
@ApiModelProperty(example = "null", value = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@ApiModelProperty(example = "null", value = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public User email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(example = "null", value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public User password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@ApiModelProperty(example = "null", value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public User phone(String phone) {
this.phone = phone;
return this;
}
/**
* Get phone
* @return phone
**/
@ApiModelProperty(example = "null", value = "")
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
/**
* User Status
* @return userStatus
**/
@ApiModelProperty(example = "null", value = "User Status")
public Integer getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
/**
* Set id
*
* @param id id
*/
public void setId(Long id) {
this.id = id;
if (o == null || getClass() != o.getClass()) {
return false;
}
/**
* Get username
* @return username
**/
@ApiModelProperty(value = "")
public String getUsername() {
return username;
}
/**
* Set username
*
* @param username username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Get firstName
* @return firstName
**/
@ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
/**
* Set firstName
*
* @param firstName firstName
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* Get lastName
* @return lastName
**/
@ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
/**
* Set lastName
*
* @param lastName lastName
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(value = "")
public String getEmail() {
return email;
}
/**
* Set email
*
* @param email email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Get password
* @return password
**/
@ApiModelProperty(value = "")
public String getPassword() {
return password;
}
/**
* Set password
*
* @param password password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* Get phone
* @return phone
**/
@ApiModelProperty(value = "")
public String getPhone() {
return phone;
}
/**
* Set phone
*
* @param phone phone
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* User Status
* @return userStatus
**/
@ApiModelProperty(value = "User Status")
public Integer getUserStatus() {
return userStatus;
}
/**
* Set userStatus
*
* @param userStatus userStatus
*/
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
@ -215,41 +222,39 @@ public class User {
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
}
}
@Override
public int hashCode() {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@Override
public int hashCode() {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
sb.append("}");
return sb.toString();
}
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o Object to be converted to indented string
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
/**
* 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 ");
}
}