[Java][Client] Fix Gradle and SBT builds for REST Assured generator (#5990)

* Fix Gradle and SBT builds for Java REST Assured generator

* Add missing jackson-databind-nullable dependency to SBT build

* Update rest-assured sample

* Add sample for Java client with REST Assured and Jackson

* Add new REST Assured sample as Maven sub-module
This commit is contained in:
Jochen Schalanda 2020-04-22 05:19:17 +02:00 committed by GitHub
parent 12512cf720
commit 40be1c311e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
240 changed files with 23146 additions and 125 deletions

View File

@ -0,0 +1,16 @@
{
"!include": "bin/java-petstore-rest-assured-jackson.json",
"generatorName": "java",
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
"outputDir": "samples/client/petstore/java/rest-assured-jackson",
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/rest-assured",
"additionalProperties": {
"hideGenerationTimestamp": true,
"booleanGetterPrefix": "is",
"java8": "true",
"dateLibrary": "java8",
"serializationLibrary": "jackson",
"useBeanValidation": "true",
"performBeanValidation": "true"
}
}

View File

@ -12,6 +12,7 @@
./bin/java-petstore-okhttp-gson-parcelable.sh
./bin/java-petstore-okhttp-gson.sh
./bin/java-petstore-rest-assured.sh
./bin/java-petstore-rest-assured-jackson.sh
./bin/java-petstore-resteasy.sh
./bin/java-petstore-resttemplate-withxml.sh
./bin/java-petstore-resttemplate.sh

View File

@ -0,0 +1,4 @@
{
"library": "rest-assured",
"artifactId": "petstore-rest-assured-jackson"
}

View File

@ -0,0 +1,36 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
target_dir="./samples/client/petstore/java/rest-assured-jackson/"
if [ ! -f "$executable" ]
then
mvn -B clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
args="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured-jackson.json -o ${target_dir} --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is --additional-properties java8=true --additional-properties dateLibrary=java8 --additional-properties serializationLibrary=jackson $@"
echo "Removing ${target_dir}"
rm -rf "${target_dir}"
java $JAVA_OPTS -jar $executable $args

View File

@ -20,4 +20,5 @@ call .\bin\windows\java-petstore-webclient.bat
call .\bin\windows\java-petstore-resteasy.bat
call .\bin\windows\java-petstore-google-api-client.bat
call .\bin\windows\java-petstore-rest-assured.bat
call .\bin\windows\java-petstore-rest-assured-jackson.bat
call .\bin\windows\java-petstore-vertx.bat

View File

@ -0,0 +1,10 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\rest-assured -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured-jackson.json -o samples\client\petstore\java\rest-assured-jackson --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,java8=true,dateLibrary=java8,serializationLibrary=jackson,useBeanValidation=true,performBeanValidation=true,
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -101,7 +101,10 @@ ext {
{{#jackson}}
jackson_version = "2.10.3"
jackson_databind_version = "2.10.3"
jackson_databind_nullable_version = 0.2.1
jackson_databind_nullable_version = "0.2.1"
{{#threetenbp}}
jackson_threetenbp_version = "2.10.0"
{{/threetenbp}}
{{/jackson}}
{{#gson}}
gson_version = "2.8.6"
@ -119,13 +122,25 @@ ext {
dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.findbugs:jsr305:3.0.2"
compile "io.rest-assured:scala-support:$rest_assured_version"
compile "io.rest-assured:rest-assured:$rest_assured_version"
{{#jackson}}
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
{{#withXml}}
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version"
{{/withXml}}
{{#joda}}
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
{{/joda}}
{{#java8}}
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
{{/java8}}
{{#threetenbp}}
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version"
{{/threetenbp}}
{{/jackson}}
{{#gson}}
compile "io.gsonfire:gson-fire:$gson_fire_version"

View File

@ -10,11 +10,26 @@ lazy val root = (project in file(".")).
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.21",
"io.rest-assured" % "rest-assured" % "4.3.0",
"io.rest-assured" % "scala-support" % "4.3.0",
"com.google.code.findbugs" % "jsr305" % "3.0.2",
{{#jackson}}
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3",
"org.openapitools" % "jackson-databind-nullable" % "0.2.1",
{{#withXml}}
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3",
{{/withXml}}
{{#joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3",
{{/joda}}
{{#java8}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3",
{{/java8}}
{{#threetenbp}}
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0",
{{/threetenbp}}
{{/jackson}}
{{#gson}}
"com.google.code.gson" % "gson" % "2.8.6",
@ -31,7 +46,7 @@ lazy val root = (project in file(".")).
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
{{/useBeanValidation}}
{{#performBeanValidation}}
"org.hibernate" % "hibernate-validator" "6.0.19.Final" % "compile",
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
{{/performBeanValidation}}
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"

View File

@ -1320,6 +1320,7 @@
<module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java/google-api-client</module>
<module>samples/client/petstore/java/rest-assured</module>
<module>samples/client/petstore/java/rest-assured-jackson</module>
<module>samples/client/petstore/groovy</module>
<!-- servers -->
<module>samples/server/petstore/jaxrs-jersey</module>

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 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1 @@
4.3.1-SNAPSHOT

View File

@ -0,0 +1,22 @@
#
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
# Ref: https://docs.travis-ci.com/user/languages/java/
#
language: java
jdk:
- openjdk12
- openjdk11
- openjdk10
- openjdk9
- openjdk8
before_install:
# ensure gradlew has proper permission
- chmod a+x ./gradlew
script:
# test using maven
#- mvn test
# test using gradle
- gradle test
# test using sbt
# - sbt test

View File

@ -0,0 +1,43 @@
# petstore-rest-assured-jackson
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation & Usage
To install the API client library to your local Maven repository, simply execute:
```shell
mvn install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn deploy
```
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
```xml
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>petstore-rest-assured-jackson</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
## Author

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,121 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'org.openapitools'
version = '1.0.0'
buildscript {
repositories {
maven { url "https://repo1.maven.org/maven2" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
repositories {
jcenter()
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
dependencies {
provided 'javax.annotation:jsr250-api:1.0'
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
install {
repositories.mavenInstaller {
pom.artifactId = 'petstore-rest-assured-jackson'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}
ext {
swagger_annotations_version = "1.5.21"
rest_assured_version = "4.3.0"
junit_version = "4.13"
jackson_version = "2.10.3"
jackson_databind_version = "2.10.3"
jackson_databind_nullable_version = "0.2.1"
okio_version = "1.17.5"
}
dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.findbugs:jsr305:3.0.2"
compile "io.rest-assured:rest-assured:$rest_assured_version"
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
compile "com.squareup.okio:okio:$okio_version"
compile "javax.validation:validation-api:2.0.1.Final"
compile "org.hibernate:hibernate-validator:6.0.19.Final"
testCompile "junit:junit:$junit_version"
}

View File

@ -0,0 +1,27 @@
lazy val root = (project in file(".")).
settings(
organization := "org.openapitools",
name := "petstore-rest-assured-jackson",
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.21",
"io.rest-assured" % "rest-assured" % "4.3.0",
"io.rest-assured" % "scala-support" % "4.3.0",
"com.google.code.findbugs" % "jsr305" % "3.0.2",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3",
"org.openapitools" % "jackson-databind-nullable" % "0.2.1",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3",
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
)

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesAnyType
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesArray
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesBoolean
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,22 @@
# AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapString** | **Map&lt;String, String&gt;** | | [optional]
**mapNumber** | [**Map&lt;String, BigDecimal&gt;**](BigDecimal.md) | | [optional]
**mapInteger** | **Map&lt;String, Integer&gt;** | | [optional]
**mapBoolean** | **Map&lt;String, Boolean&gt;** | | [optional]
**mapArrayInteger** | [**Map&lt;String, List&lt;Integer&gt;&gt;**](List.md) | | [optional]
**mapArrayAnytype** | [**Map&lt;String, List&lt;Object&gt;&gt;**](List.md) | | [optional]
**mapMapString** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapMapAnytype** | [**Map&lt;String, Map&lt;String, Object&gt;&gt;**](Map.md) | | [optional]
**anytype1** | [**Object**](.md) | | [optional]
**anytype2** | [**Object**](.md) | | [optional]
**anytype3** | [**Object**](.md) | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesInteger
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesNumber
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesString
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,13 @@
# Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional]

View File

@ -0,0 +1,51 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="call123testSpecialTags"></a>
# **call123testSpecialTags**
> Client call123testSpecialTags(body)
To test special tags
To test special tags and operation ID starting with number
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake();
api.call123testSpecialTags()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

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

View File

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

View File

@ -0,0 +1,14 @@
# ArrayTest
## Properties
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]

View File

@ -0,0 +1,23 @@
# BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional]
## Enum: KindEnum
Name | Value
---- | -----
LIONS | &quot;lions&quot;
TIGERS | &quot;tigers&quot;
LEOPARDS | &quot;leopards&quot;
JAGUARS | &quot;jaguars&quot;

View File

@ -0,0 +1,23 @@
# BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional]
## Enum: KindEnum
Name | Value
---- | -----
LIONS | &quot;lions&quot;
TIGERS | &quot;tigers&quot;
LEOPARDS | &quot;leopards&quot;
JAGUARS | &quot;jaguars&quot;

View File

@ -0,0 +1,17 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**scAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]

View File

@ -1,9 +1,12 @@
# StringBooleanMap
# Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **Boolean** | | [optional]

View File

@ -0,0 +1,12 @@
# CatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **Boolean** | | [optional]

View File

@ -0,0 +1,13 @@
# Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**name** | **String** | |

View File

@ -0,0 +1,13 @@
# ClassModel
Model for testing model with \"_class\" property
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **String** | | [optional]

View File

@ -1,9 +1,12 @@
# AnimalFarm
# Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# DogAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]

View File

@ -0,0 +1,31 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
**arrayEnum** | [**List&lt;ArrayEnumEnum&gt;**](#List&lt;ArrayEnumEnum&gt;) | | [optional]
## Enum: JustSymbolEnum
Name | Value
---- | -----
GREATER_THAN_OR_EQUAL_TO | &quot;&gt;&#x3D;&quot;
DOLLAR | &quot;$&quot;
## Enum: List&lt;ArrayEnumEnum&gt;
Name | Value
---- | -----
FISH | &quot;fish&quot;
CRAB | &quot;crab&quot;

View File

@ -0,0 +1,15 @@
# EnumClass
## Enum
* `_ABC` (value: `"_abc"`)
* `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `"(xyz)"`)

View File

@ -0,0 +1,54 @@
# EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
## Enum: EnumStringEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
## Enum: EnumStringRequiredEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
## Enum: EnumIntegerEnum
Name | Value
---- | -----
NUMBER_1 | 1
NUMBER_MINUS_1 | -1
## Enum: EnumNumberEnum
Name | Value
---- | -----
NUMBER_1_DOT_1 | 1.1
NUMBER_MINUS_1_DOT_2 | -1.2

View File

@ -0,0 +1,641 @@
# FakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
<a name="createXmlItem"></a>
# **createXmlItem**
> createXmlItem(xmlItem)
creates an XmlItem
this route creates an XmlItem
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.createXmlItem()
.body(xmlItem).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
- **Accept**: Not defined
<a name="fakeOuterBooleanSerialize"></a>
# **fakeOuterBooleanSerialize**
> Boolean fakeOuterBooleanSerialize(body)
Test serialization of outer boolean types
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Boolean**| Input boolean as post body | [optional]
### Return type
**Boolean**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
<a name="fakeOuterCompositeSerialize"></a>
# **fakeOuterCompositeSerialize**
> OuterComposite fakeOuterCompositeSerialize(body)
Test serialization of object with outer number type
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
<a name="fakeOuterNumberSerialize"></a>
# **fakeOuterNumberSerialize**
> BigDecimal fakeOuterNumberSerialize(body)
Test serialization of outer number types
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.fakeOuterNumberSerialize().execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **BigDecimal**| Input number as post body | [optional]
### Return type
[**BigDecimal**](BigDecimal.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
<a name="fakeOuterStringSerialize"></a>
# **fakeOuterStringSerialize**
> String fakeOuterStringSerialize(body)
Test serialization of outer string types
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.fakeOuterStringSerialize().execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **String**| Input string as post body | [optional]
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
<a name="testBodyWithFileSchema"></a>
# **testBodyWithFileSchema**
> testBodyWithFileSchema(body)
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testBodyWithFileSchema()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testBodyWithQueryParams"></a>
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, body)
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testBodyWithQueryParams()
.queryQuery(query)
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **String**| |
**body** | [**User**](User.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(body)
To test \&quot;client\&quot; model
To test \&quot;client\&quot; model
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testClientModel()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testEndpointParameters()
.numberForm(number)
._doubleForm(_double)
.patternWithoutDelimiterForm(patternWithoutDelimiter)
._byteForm(_byte).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **BigDecimal**| None |
**_double** | **Double**| None |
**patternWithoutDelimiter** | **String**| None |
**_byte** | **byte[]**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Long**| None | [optional]
**_float** | **Float**| None | [optional]
**string** | **String**| None | [optional]
**binary** | **File**| None | [optional]
**date** | **LocalDate**| None | [optional]
**dateTime** | **OffsetDateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]
### Return type
null (empty response body)
### Authorization
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
To test enum parameters
To test enum parameters
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testEnumParameters().execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**List&lt;String&gt;**](String.md)| Header parameter enum test (string array) | [optional] [default to new ArrayList&lt;&gt;()] [enum: >, $]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**List&lt;String&gt;**](String.md)| Query parameter enum test (string array) | [optional] [default to new ArrayList&lt;&gt;()] [enum: >, $]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**List&lt;String&gt;**](String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testGroupParameters"></a>
# **testGroupParameters**
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testGroupParameters()
.requiredStringGroupQuery(requiredStringGroup)
.requiredBooleanGroupHeader(requiredBooleanGroup)
.requiredInt64GroupQuery(requiredInt64Group).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requiredStringGroup** | **Integer**| Required String in group parameters |
**requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
**requiredInt64Group** | **Long**| Required Integer in group parameters |
**stringGroup** | **Integer**| String in group parameters | [optional]
**booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
**int64Group** | **Long**| Integer in group parameters | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="testInlineAdditionalProperties"></a>
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(param)
test inline additionalProperties
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testInlineAdditionalProperties()
.body(param).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | [**Map&lt;String, String&gt;**](String.md)| request body |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testJsonFormData"></a>
# **testJsonFormData**
> testJsonFormData(param, param2)
test json serialization of form data
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testJsonFormData()
.paramForm(param)
.param2Form(param2).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **String**| field1 |
**param2** | **String**| field2 |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testQueryParameterCollectionFormat"></a>
# **testQueryParameterCollectionFormat**
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
To test the collection format in query parameters
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
api.testQueryParameterCollectionFormat()
.pipeQuery(pipe)
.ioutilQuery(ioutil)
.httpQuery(http)
.urlQuery(url)
.contextQuery(context).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**ioutil** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**http** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**url** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**context** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined

View File

@ -0,0 +1,51 @@
# FakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
To test class name in snake case
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
FakeClassnameTags123Api api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).fakeClassnameTags123();
api.testClassname()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
[api_key_query](../README.md#api_key_query)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@ -0,0 +1,13 @@
# FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**java.io.File**](java.io.File.md) | | [optional]
**files** | [**List&lt;java.io.File&gt;**](java.io.File.md) | | [optional]

View File

@ -0,0 +1,25 @@
# FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer** | **Integer** | | [optional]
**int32** | **Integer** | | [optional]
**int64** | **Long** | | [optional]
**number** | [**BigDecimal**](BigDecimal.md) | |
**_float** | **Float** | | [optional]
**_double** | **Double** | | [optional]
**string** | **String** | | [optional]
**_byte** | **byte[]** | |
**binary** | [**File**](File.md) | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | |
**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional]

View File

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

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]
**mapOfEnumString** | [**Map&lt;String, InnerEnum&gt;**](#Map&lt;String, InnerEnum&gt;) | | [optional]
**directMap** | **Map&lt;String, Boolean&gt;** | | [optional]
**indirectMap** | **Map&lt;String, Boolean&gt;** | | [optional]
## Enum: Map&lt;String, InnerEnum&gt;
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;

View File

@ -0,0 +1,14 @@
# MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -0,0 +1,14 @@
# Model200Response
Model for testing model name starting with number
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,14 @@
# ModelApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -0,0 +1,13 @@
# ModelReturn
Model for testing reserved words
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | | [optional]

View File

@ -0,0 +1,16 @@
# Name
Model for testing model name same as property name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional] [readonly]
**property** | **String** | | [optional]
**_123number** | **Integer** | | [optional] [readonly]

View File

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

View File

@ -0,0 +1,27 @@
# Order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**petId** | **Long** | | [optional]
**quantity** | **Integer** | | [optional]
**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
**complete** | **Boolean** | | [optional]
## Enum: StatusEnum
Name | Value
---- | -----
PLACED | &quot;placed&quot;
APPROVED | &quot;approved&quot;
DELIVERED | &quot;delivered&quot;

View File

@ -0,0 +1,14 @@
# OuterComposite
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**myString** | **String** | | [optional]
**myBoolean** | **Boolean** | | [optional]

View File

@ -0,0 +1,15 @@
# OuterEnum
## Enum
* `PLACED` (value: `"placed"`)
* `APPROVED` (value: `"approved"`)
* `DELIVERED` (value: `"delivered"`)

View File

@ -0,0 +1,27 @@
# Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List&lt;String&gt;** | |
**tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
## Enum: StatusEnum
Name | Value
---- | -----
AVAILABLE | &quot;available&quot;
PENDING | &quot;pending&quot;
SOLD | &quot;sold&quot;

View File

@ -0,0 +1,391 @@
# PetApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
<a name="addPet"></a>
# **addPet**
> addPet(body)
Add a new pet to the store
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.addPet()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
<a name="deletePet"></a>
# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.deletePet()
.petIdPath(petId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.findPetsByStatus()
.statusQuery(status).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List&lt;String&gt;**](String.md)| Status values that need to be considered for filter | [default to new ArrayList&lt;&gt;()] [enum: available, pending, sold]
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="findPetsByTags"></a>
# **findPetsByTags**
> List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.findPetsByTags()
.tagsQuery(tags).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by | [default to new ArrayList&lt;&gt;()]
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="getPetById"></a>
# **getPetById**
> Pet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.getPetById()
.petIdPath(petId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to return |
### Return type
[**Pet**](Pet.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="updatePet"></a>
# **updatePet**
> updatePet(body)
Update an existing pet
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.updatePet()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
<a name="updatePetWithForm"></a>
# **updatePetWithForm**
> updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.updatePetWithForm()
.petIdPath(petId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="uploadFile"></a>
# **uploadFile**
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.uploadFile()
.petIdPath(petId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **File**| file to upload | [optional]
### Return type
[**ModelApiResponse**](ModelApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
<a name="uploadFileWithRequiredFile"></a>
# **uploadFileWithRequiredFile**
> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
uploads an image (required)
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
api.uploadFileWithRequiredFile()
.petIdPath(petId)
.requiredFileMultiPart(requiredFile).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to update |
**requiredFile** | **File**| file to upload |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
### Return type
[**ModelApiResponse**](ModelApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json

View File

@ -0,0 +1,13 @@
# ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional] [readonly]
**baz** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# SpecialModelName
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**$specialPropertyName** | **Long** | | [optional]

View File

@ -0,0 +1,174 @@
# StoreApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
<a name="deleteOrder"></a>
# **deleteOrder**
> deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
api.deleteOrder()
.orderIdPath(orderId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of the order that needs to be deleted |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="getInventory"></a>
# **getInventory**
> Map&lt;String, Integer&gt; getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
api.getInventory().execute(r -> r.prettyPeek());
```
### Parameters
This endpoint does not need any parameter.
### Return type
**Map&lt;String, Integer&gt;**
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getOrderById"></a>
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
api.getOrderById()
.orderIdPath(orderId).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **Long**| ID of pet that needs to be fetched |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(body)
Place an order for a pet
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
StoreApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).store();
api.placeOrder()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -0,0 +1,13 @@
# Tag
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**name** | **String** | | [optional]

View File

@ -0,0 +1,16 @@
# TypeHolderDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**stringItem** | **String** | |
**numberItem** | [**BigDecimal**](BigDecimal.md) | |
**integerItem** | **Integer** | |
**boolItem** | **Boolean** | |
**arrayItem** | **List&lt;Integer&gt;** | |

View File

@ -0,0 +1,17 @@
# TypeHolderExample
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**stringItem** | **String** | |
**numberItem** | [**BigDecimal**](BigDecimal.md) | |
**floatItem** | **Float** | |
**integerItem** | **Integer** | |
**boolItem** | **Boolean** | |
**arrayItem** | **List&lt;Integer&gt;** | |

View File

@ -0,0 +1,19 @@
# User
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **Integer** | User Status | [optional]

View File

@ -0,0 +1,342 @@
# UserApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
<a name="createUser"></a>
# **createUser**
> createUser(body)
Create user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUser()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> createUsersWithArrayInput(body)
Creates list of users with given input array
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUsersWithArrayInput()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="createUsersWithListInput"></a>
# **createUsersWithListInput**
> createUsersWithListInput(body)
Creates list of users with given input array
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.createUsersWithListInput()
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="deleteUser"></a>
# **deleteUser**
> deleteUser(username)
Delete user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.deleteUser()
.usernamePath(username).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be deleted |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="getUserByName"></a>
# **getUserByName**
> User getUserByName(username)
Get user by user name
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.getUserByName()
.usernamePath(username).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
[**User**](User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="loginUser"></a>
# **loginUser**
> String loginUser(username, password)
Logs user into the system
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.loginUser()
.usernameQuery(username)
.passwordQuery(password).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="logoutUser"></a>
# **logoutUser**
> logoutUser()
Logs out current logged in user session
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.logoutUser().execute(r -> r.prettyPeek());
```
### Parameters
This endpoint does not need any parameter.
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="updateUser"></a>
# **updateUser**
> updateUser(username, body)
Updated user
This can only be done by the logged in user.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiClient;
//import io.restassured.builder.RequestSpecBuilder;
//import io.restassured.filter.log.ErrorLoggingFilter;
UserApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
() -> new RequestSpecBuilder()
.setBaseUri("http://petstore.swagger.io:80/v2"))).user();
api.updateUser()
.usernamePath(username)
.body(body).execute(r -> r.prettyPeek());
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined

View File

@ -0,0 +1,40 @@
# XmlItem
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attributeString** | **String** | | [optional]
**attributeNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**attributeInteger** | **Integer** | | [optional]
**attributeBoolean** | **Boolean** | | [optional]
**wrappedArray** | **List&lt;Integer&gt;** | | [optional]
**nameString** | **String** | | [optional]
**nameNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**nameInteger** | **Integer** | | [optional]
**nameBoolean** | **Boolean** | | [optional]
**nameArray** | **List&lt;Integer&gt;** | | [optional]
**nameWrappedArray** | **List&lt;Integer&gt;** | | [optional]
**prefixString** | **String** | | [optional]
**prefixNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**prefixInteger** | **Integer** | | [optional]
**prefixBoolean** | **Boolean** | | [optional]
**prefixArray** | **List&lt;Integer&gt;** | | [optional]
**prefixWrappedArray** | **List&lt;Integer&gt;** | | [optional]
**namespaceString** | **String** | | [optional]
**namespaceNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**namespaceInteger** | **Integer** | | [optional]
**namespaceBoolean** | **Boolean** | | [optional]
**namespaceArray** | **List&lt;Integer&gt;** | | [optional]
**namespaceWrappedArray** | **List&lt;Integer&gt;** | | [optional]
**prefixNsString** | **String** | | [optional]
**prefixNsNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**prefixNsInteger** | **Integer** | | [optional]
**prefixNsBoolean** | **Boolean** | | [optional]
**prefixNsArray** | **List&lt;Integer&gt;** | | [optional]
**prefixNsWrappedArray** | **List&lt;Integer&gt;** | | [optional]

View File

@ -0,0 +1,58 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${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://${git_host}/${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,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# 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
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# 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
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
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" -a "$nonstop" = "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 or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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=`expr $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
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

View File

@ -0,0 +1,100 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@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
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@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="-Xmx64m" "-Xms64m"
@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
: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=%*
: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,287 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>petstore-rest-assured-jackson</artifactId>
<packaging>jar</packaging>
<name>petstore-rest-assured-jackson</name>
<version>1.0.0</version>
<url>https://github.com/openapitools/openapi-generator</url>
<description>OpenAPI Java</description>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
<developerConnection>scm:git:git@github.com:openapitools/openapi-generator.git</developerConnection>
<url>https://github.com/openapitools/openapi-generator</url>
</scm>
<licenses>
<license>
<name>Unlicense</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>OpenAPI-Generator Contributors</name>
<email>team@openapitools.org</email>
<organization>OpenAPITools.org</organization>
<organizationUrl>http://openapitools.org</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.0.5</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<reuseForks>false</reuseForks>
<forkCount>1C</forkCount>
</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>3.1.0</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest-assured.version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>${okio-version}</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<scope>provided</scope>
</dependency>
<!-- Bean Validation Impl. used to perform BeanValidation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.19.Final</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.21</swagger-annotations-version>
<rest-assured.version>4.3.0</rest-assured.version>
<gson-version>2.8.6</gson-version>
<gson-fire-version>1.8.4</gson-fire-version>
<jackson-version>2.10.3</jackson-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<okio-version>1.17.5</okio-version>
<junit-version>4.13</junit-version>
</properties>
</project>

View File

@ -0,0 +1 @@
rootProject.name = "petstore-rest-assured-jackson"

View File

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

View File

@ -0,0 +1,78 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client;
import org.openapitools.client.api.*;
import io.restassured.builder.RequestSpecBuilder;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static io.restassured.config.ObjectMapperConfig.objectMapperConfig;
import static io.restassured.config.RestAssuredConfig.config;
import static org.openapitools.client.JacksonObjectMapper.jackson;
public class ApiClient {
public static final String BASE_URI = "http://petstore.swagger.io:80/v2";
private final Config config;
private ApiClient(Config config) {
this.config = config;
}
public static ApiClient api(Config config) {
return new ApiClient(config);
}
public AnotherFakeApi anotherFake() {
return AnotherFakeApi.anotherFake(config.reqSpecSupplier);
}
public FakeApi fake() {
return FakeApi.fake(config.reqSpecSupplier);
}
public FakeClassnameTags123Api fakeClassnameTags123() {
return FakeClassnameTags123Api.fakeClassnameTags123(config.reqSpecSupplier);
}
public PetApi pet() {
return PetApi.pet(config.reqSpecSupplier);
}
public StoreApi store() {
return StoreApi.store(config.reqSpecSupplier);
}
public UserApi user() {
return UserApi.user(config.reqSpecSupplier);
}
public static class Config {
private Supplier<RequestSpecBuilder> reqSpecSupplier = () -> new RequestSpecBuilder()
.setBaseUri(BASE_URI)
.setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper(jackson())));
/**
* Use common specification for all operations
* @param supplier supplier
* @return configuration
*/
public Config reqSpecSupplier(Supplier<RequestSpecBuilder> supplier) {
this.reqSpecSupplier = supplier;
return this;
}
public static Config apiConfig() {
return new Config();
}
}
}

View File

@ -0,0 +1,27 @@
package org.openapitools.client;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;
public class BeanValidationException extends ValidationException {
/**
*
*/
private static final long serialVersionUID = -5294733947409491364L;
Set<ConstraintViolation<Object>> violations;
public BeanValidationException(Set<ConstraintViolation<Object>> violations) {
this.violations = violations;
}
public Set<ConstraintViolation<Object>> getViolations() {
return violations;
}
public void setViolations(Set<ConstraintViolation<Object>> violations) {
this.violations = violations;
}
}

View File

@ -0,0 +1,52 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.*;
import org.openapitools.jackson.nullable.JsonNullableModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.restassured.internal.mapping.Jackson2Mapper;
import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory;
public class JacksonObjectMapper extends Jackson2Mapper {
private JacksonObjectMapper() {
super(createFactory());
}
private static Jackson2ObjectMapperFactory createFactory() {
return (cls, charset) -> {
ObjectMapper mapper = new ObjectMapper();
mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
mapper.setDateFormat(new RFC3339DateFormat());
mapper.registerModule(new JavaTimeModule());
JsonNullableModule jnm = new JsonNullableModule();
mapper.registerModule(jnm);
return mapper;
};
}
public static JacksonObjectMapper jackson() {
return new JacksonObjectMapper();
}
}

View File

@ -0,0 +1,32 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client;
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import java.text.FieldPosition;
import java.util.Date;
public class RFC3339DateFormat extends ISO8601DateFormat {
// Same as ISO8601DateFormat but serializing milliseconds.
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
String value = ISO8601Utils.format(date, true);
toAppendTo.append(value);
return toAppendTo;
}
}

View File

@ -0,0 +1,42 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.response.Response;
import io.restassured.specification.ResponseSpecification;
import java.util.function.Function;
public class ResponseSpecBuilders {
private ResponseSpecBuilders() {
}
public static Function<Response, Response> validatedWith(ResponseSpecification respSpec) {
return response -> response.then().spec(respSpec).extract().response();
}
public static Function<Response, Response> validatedWith(ResponseSpecBuilder respSpec) {
return validatedWith(respSpec.build());
}
/**
* @param code expected status code
* @return ResponseSpecBuilder
*/
public static ResponseSpecBuilder shouldBeCode(int code) {
return new ResponseSpecBuilder().expectStatusCode(code);
}
}

View File

@ -0,0 +1,58 @@
package org.openapitools.client;
import java.util.Map;
/**
* Representing a Server configuration.
*/
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A describtion of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replaceAll("\\{" + name + "\\}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}

View File

@ -0,0 +1,23 @@
package org.openapitools.client;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}

View File

@ -0,0 +1,157 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.common.mapper.TypeRef;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.swagger.annotations.*;
import java.lang.reflect.Type;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.restassured.http.Method.*;
@Api(value = "AnotherFake")
public class AnotherFakeApi {
private Supplier<RequestSpecBuilder> reqSpecSupplier;
private Consumer<RequestSpecBuilder> reqSpecCustomizer;
private AnotherFakeApi(Supplier<RequestSpecBuilder> reqSpecSupplier) {
this.reqSpecSupplier = reqSpecSupplier;
}
public static AnotherFakeApi anotherFake(Supplier<RequestSpecBuilder> reqSpecSupplier) {
return new AnotherFakeApi(reqSpecSupplier);
}
private RequestSpecBuilder createReqSpec() {
RequestSpecBuilder reqSpec = reqSpecSupplier.get();
if(reqSpecCustomizer != null) {
reqSpecCustomizer.accept(reqSpec);
}
return reqSpec;
}
public List<Oper> getAllOperations() {
return Arrays.asList(
call123testSpecialTags()
);
}
@ApiOperation(value = "To test special tags",
notes = "To test special tags and operation ID starting with number",
nickname = "call123testSpecialTags",
tags = { "$another-fake?" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public Call123testSpecialTagsOper call123testSpecialTags() {
return new Call123testSpecialTagsOper(createReqSpec());
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return api
*/
public AnotherFakeApi reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
this.reqSpecCustomizer = reqSpecCustomizer;
return this;
}
/**
* To test special tags
* To test special tags and operation ID starting with number
*
* @see #body client model (required)
* return Client
*/
public static class Call123testSpecialTagsOper implements Oper {
public static final Method REQ_METHOD = PATCH;
public static final String REQ_URI = "/another-fake/dummy";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public Call123testSpecialTagsOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("application/json");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* PATCH /another-fake/dummy
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* PATCH /another-fake/dummy
* @param handler handler
* @return Client
*/
public Client executeAs(Function<Response, Response> handler) {
TypeRef<Client> type = new TypeRef<Client>(){};
return execute(handler).as(type);
}
/**
* @param body (Client) client model (required)
* @return operation
*/
public Call123testSpecialTagsOper body(Client body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public Call123testSpecialTagsOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public Call123testSpecialTagsOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
}

View File

@ -0,0 +1,157 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.common.mapper.TypeRef;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.swagger.annotations.*;
import java.lang.reflect.Type;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.restassured.http.Method.*;
@Api(value = "FakeClassnameTags123")
public class FakeClassnameTags123Api {
private Supplier<RequestSpecBuilder> reqSpecSupplier;
private Consumer<RequestSpecBuilder> reqSpecCustomizer;
private FakeClassnameTags123Api(Supplier<RequestSpecBuilder> reqSpecSupplier) {
this.reqSpecSupplier = reqSpecSupplier;
}
public static FakeClassnameTags123Api fakeClassnameTags123(Supplier<RequestSpecBuilder> reqSpecSupplier) {
return new FakeClassnameTags123Api(reqSpecSupplier);
}
private RequestSpecBuilder createReqSpec() {
RequestSpecBuilder reqSpec = reqSpecSupplier.get();
if(reqSpecCustomizer != null) {
reqSpecCustomizer.accept(reqSpec);
}
return reqSpec;
}
public List<Oper> getAllOperations() {
return Arrays.asList(
testClassname()
);
}
@ApiOperation(value = "To test class name in snake case",
notes = "To test class name in snake case",
nickname = "testClassname",
tags = { "fake_classname_tags 123#$%^" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public TestClassnameOper testClassname() {
return new TestClassnameOper(createReqSpec());
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return api
*/
public FakeClassnameTags123Api reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
this.reqSpecCustomizer = reqSpecCustomizer;
return this;
}
/**
* To test class name in snake case
* To test class name in snake case
*
* @see #body client model (required)
* return Client
*/
public static class TestClassnameOper implements Oper {
public static final Method REQ_METHOD = PATCH;
public static final String REQ_URI = "/fake_classname_test";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public TestClassnameOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("application/json");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* PATCH /fake_classname_test
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* PATCH /fake_classname_test
* @param handler handler
* @return Client
*/
public Client executeAs(Function<Response, Response> handler) {
TypeRef<Client> type = new TypeRef<Client>(){};
return execute(handler).as(type);
}
/**
* @param body (Client) client model (required)
* @return operation
*/
public TestClassnameOper body(Client body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public TestClassnameOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public TestClassnameOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
}

View File

@ -0,0 +1,24 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import io.restassured.response.Response;
import java.util.function.Function;
public interface Oper {
<T> T execute(Function<Response, T> handler);
}

View File

@ -0,0 +1,885 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import java.io.File;
import org.openapitools.client.model.ModelApiResponse;
import org.openapitools.client.model.Pet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.common.mapper.TypeRef;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.swagger.annotations.*;
import java.lang.reflect.Type;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.restassured.http.Method.*;
@Api(value = "Pet")
public class PetApi {
private Supplier<RequestSpecBuilder> reqSpecSupplier;
private Consumer<RequestSpecBuilder> reqSpecCustomizer;
private PetApi(Supplier<RequestSpecBuilder> reqSpecSupplier) {
this.reqSpecSupplier = reqSpecSupplier;
}
public static PetApi pet(Supplier<RequestSpecBuilder> reqSpecSupplier) {
return new PetApi(reqSpecSupplier);
}
private RequestSpecBuilder createReqSpec() {
RequestSpecBuilder reqSpec = reqSpecSupplier.get();
if(reqSpecCustomizer != null) {
reqSpecCustomizer.accept(reqSpec);
}
return reqSpec;
}
public List<Oper> getAllOperations() {
return Arrays.asList(
addPet(),
deletePet(),
findPetsByStatus(),
findPetsByTags(),
getPetById(),
updatePet(),
updatePetWithForm(),
uploadFile(),
uploadFileWithRequiredFile()
);
}
@ApiOperation(value = "Add a new pet to the store",
notes = "",
nickname = "addPet",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 405, message = "Invalid input") })
public AddPetOper addPet() {
return new AddPetOper(createReqSpec());
}
@ApiOperation(value = "Deletes a pet",
notes = "",
nickname = "deletePet",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid pet value") })
public DeletePetOper deletePet() {
return new DeletePetOper(createReqSpec());
}
@ApiOperation(value = "Finds Pets by status",
notes = "Multiple status values can be provided with comma separated strings",
nickname = "findPetsByStatus",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid status value") })
public FindPetsByStatusOper findPetsByStatus() {
return new FindPetsByStatusOper(createReqSpec());
}
@ApiOperation(value = "Finds Pets by tags",
notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
nickname = "findPetsByTags",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid tag value") })
@Deprecated
public FindPetsByTagsOper findPetsByTags() {
return new FindPetsByTagsOper(createReqSpec());
}
@ApiOperation(value = "Find pet by ID",
notes = "Returns a single pet",
nickname = "getPetById",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid ID supplied") ,
@ApiResponse(code = 404, message = "Pet not found") })
public GetPetByIdOper getPetById() {
return new GetPetByIdOper(createReqSpec());
}
@ApiOperation(value = "Update an existing pet",
notes = "",
nickname = "updatePet",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid ID supplied") ,
@ApiResponse(code = 404, message = "Pet not found") ,
@ApiResponse(code = 405, message = "Validation exception") })
public UpdatePetOper updatePet() {
return new UpdatePetOper(createReqSpec());
}
@ApiOperation(value = "Updates a pet in the store with form data",
notes = "",
nickname = "updatePetWithForm",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
public UpdatePetWithFormOper updatePetWithForm() {
return new UpdatePetWithFormOper(createReqSpec());
}
@ApiOperation(value = "uploads an image",
notes = "",
nickname = "uploadFile",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public UploadFileOper uploadFile() {
return new UploadFileOper(createReqSpec());
}
@ApiOperation(value = "uploads an image (required)",
notes = "",
nickname = "uploadFileWithRequiredFile",
tags = { "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public UploadFileWithRequiredFileOper uploadFileWithRequiredFile() {
return new UploadFileWithRequiredFileOper(createReqSpec());
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return api
*/
public PetApi reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
this.reqSpecCustomizer = reqSpecCustomizer;
return this;
}
/**
* Add a new pet to the store
*
*
* @see #body Pet object that needs to be added to the store (required)
*/
public static class AddPetOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/pet";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public AddPetOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("application/json");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /pet
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (Pet) Pet object that needs to be added to the store (required)
* @return operation
*/
public AddPetOper body(Pet body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public AddPetOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public AddPetOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Deletes a pet
*
*
* @see #petIdPath Pet id to delete (required)
* @see #apiKeyHeader (optional)
*/
public static class DeletePetOper implements Oper {
public static final Method REQ_METHOD = DELETE;
public static final String REQ_URI = "/pet/{petId}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public DeletePetOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* DELETE /pet/{petId}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
public static final String API_KEY_HEADER = "api_key";
/**
* @param apiKey (String) (optional)
* @return operation
*/
public DeletePetOper apiKeyHeader(String apiKey) {
reqSpec.addHeader(API_KEY_HEADER, apiKey);
return this;
}
public static final String PET_ID_PATH = "petId";
/**
* @param petId (Long) Pet id to delete (required)
* @return operation
*/
public DeletePetOper petIdPath(Object petId) {
reqSpec.addPathParam(PET_ID_PATH, petId);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public DeletePetOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public DeletePetOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
*
* @see #statusQuery Status values that need to be considered for filter (required)
* return List&lt;Pet&gt;
*/
public static class FindPetsByStatusOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/pet/findByStatus";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public FindPetsByStatusOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /pet/findByStatus
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /pet/findByStatus
* @param handler handler
* @return List&lt;Pet&gt;
*/
public List<Pet> executeAs(Function<Response, Response> handler) {
TypeRef<List<Pet>> type = new TypeRef<List<Pet>>(){};
return execute(handler).as(type);
}
public static final String STATUS_QUERY = "status";
/**
* @param status (List&lt;String&gt;) Status values that need to be considered for filter (required)
* @return operation
*/
public FindPetsByStatusOper statusQuery(Object... status) {
reqSpec.addQueryParam(STATUS_QUERY, status);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public FindPetsByStatusOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public FindPetsByStatusOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* @see #tagsQuery Tags to filter by (required)
* return List&lt;Pet&gt;
* @deprecated
*/
@Deprecated
public static class FindPetsByTagsOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/pet/findByTags";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public FindPetsByTagsOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /pet/findByTags
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /pet/findByTags
* @param handler handler
* @return List&lt;Pet&gt;
*/
public List<Pet> executeAs(Function<Response, Response> handler) {
TypeRef<List<Pet>> type = new TypeRef<List<Pet>>(){};
return execute(handler).as(type);
}
public static final String TAGS_QUERY = "tags";
/**
* @param tags (List&lt;String&gt;) Tags to filter by (required)
* @return operation
*/
public FindPetsByTagsOper tagsQuery(Object... tags) {
reqSpec.addQueryParam(TAGS_QUERY, tags);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public FindPetsByTagsOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public FindPetsByTagsOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Find pet by ID
* Returns a single pet
*
* @see #petIdPath ID of pet to return (required)
* return Pet
*/
public static class GetPetByIdOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/pet/{petId}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public GetPetByIdOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /pet/{petId}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /pet/{petId}
* @param handler handler
* @return Pet
*/
public Pet executeAs(Function<Response, Response> handler) {
TypeRef<Pet> type = new TypeRef<Pet>(){};
return execute(handler).as(type);
}
public static final String PET_ID_PATH = "petId";
/**
* @param petId (Long) ID of pet to return (required)
* @return operation
*/
public GetPetByIdOper petIdPath(Object petId) {
reqSpec.addPathParam(PET_ID_PATH, petId);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public GetPetByIdOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public GetPetByIdOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Update an existing pet
*
*
* @see #body Pet object that needs to be added to the store (required)
*/
public static class UpdatePetOper implements Oper {
public static final Method REQ_METHOD = PUT;
public static final String REQ_URI = "/pet";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public UpdatePetOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("application/json");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* PUT /pet
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (Pet) Pet object that needs to be added to the store (required)
* @return operation
*/
public UpdatePetOper body(Pet body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public UpdatePetOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public UpdatePetOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Updates a pet in the store with form data
*
*
* @see #petIdPath ID of pet that needs to be updated (required)
* @see #nameForm Updated name of the pet (optional)
* @see #statusForm Updated status of the pet (optional)
*/
public static class UpdatePetWithFormOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/pet/{petId}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public UpdatePetWithFormOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("application/x-www-form-urlencoded");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /pet/{petId}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
public static final String PET_ID_PATH = "petId";
/**
* @param petId (Long) ID of pet that needs to be updated (required)
* @return operation
*/
public UpdatePetWithFormOper petIdPath(Object petId) {
reqSpec.addPathParam(PET_ID_PATH, petId);
return this;
}
public static final String NAME_FORM = "name";
/**
* @param name (String) Updated name of the pet (optional)
* @return operation
*/
public UpdatePetWithFormOper nameForm(Object... name) {
reqSpec.addFormParam(NAME_FORM, name);
return this;
}
public static final String STATUS_FORM = "status";
/**
* @param status (String) Updated status of the pet (optional)
* @return operation
*/
public UpdatePetWithFormOper statusForm(Object... status) {
reqSpec.addFormParam(STATUS_FORM, status);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public UpdatePetWithFormOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public UpdatePetWithFormOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* uploads an image
*
*
* @see #petIdPath ID of pet to update (required)
* @see #additionalMetadataForm Additional data to pass to server (optional)
* @see #fileMultiPart file to upload (optional)
* return ModelApiResponse
*/
public static class UploadFileOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/pet/{petId}/uploadImage";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public UploadFileOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("multipart/form-data");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /pet/{petId}/uploadImage
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* POST /pet/{petId}/uploadImage
* @param handler handler
* @return ModelApiResponse
*/
public ModelApiResponse executeAs(Function<Response, Response> handler) {
TypeRef<ModelApiResponse> type = new TypeRef<ModelApiResponse>(){};
return execute(handler).as(type);
}
public static final String PET_ID_PATH = "petId";
/**
* @param petId (Long) ID of pet to update (required)
* @return operation
*/
public UploadFileOper petIdPath(Object petId) {
reqSpec.addPathParam(PET_ID_PATH, petId);
return this;
}
public static final String ADDITIONAL_METADATA_FORM = "additionalMetadata";
/**
* @param additionalMetadata (String) Additional data to pass to server (optional)
* @return operation
*/
public UploadFileOper additionalMetadataForm(Object... additionalMetadata) {
reqSpec.addFormParam(ADDITIONAL_METADATA_FORM, additionalMetadata);
return this;
}
/**
* It will assume that the control name is file and the &lt;content-type&gt; is &lt;application/octet-stream&gt;
* @see #reqSpec for customise
* @param file (File) file to upload (optional)
* @return operation
*/
public UploadFileOper fileMultiPart(File file) {
reqSpec.addMultiPart(file);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public UploadFileOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public UploadFileOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* uploads an image (required)
*
*
* @see #petIdPath ID of pet to update (required)
* @see #requiredFileMultiPart file to upload (required)
* @see #additionalMetadataForm Additional data to pass to server (optional)
* return ModelApiResponse
*/
public static class UploadFileWithRequiredFileOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/fake/{petId}/uploadImageWithRequiredFile";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public UploadFileWithRequiredFileOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("multipart/form-data");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /fake/{petId}/uploadImageWithRequiredFile
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* POST /fake/{petId}/uploadImageWithRequiredFile
* @param handler handler
* @return ModelApiResponse
*/
public ModelApiResponse executeAs(Function<Response, Response> handler) {
TypeRef<ModelApiResponse> type = new TypeRef<ModelApiResponse>(){};
return execute(handler).as(type);
}
public static final String PET_ID_PATH = "petId";
/**
* @param petId (Long) ID of pet to update (required)
* @return operation
*/
public UploadFileWithRequiredFileOper petIdPath(Object petId) {
reqSpec.addPathParam(PET_ID_PATH, petId);
return this;
}
public static final String ADDITIONAL_METADATA_FORM = "additionalMetadata";
/**
* @param additionalMetadata (String) Additional data to pass to server (optional)
* @return operation
*/
public UploadFileWithRequiredFileOper additionalMetadataForm(Object... additionalMetadata) {
reqSpec.addFormParam(ADDITIONAL_METADATA_FORM, additionalMetadata);
return this;
}
/**
* It will assume that the control name is file and the &lt;content-type&gt; is &lt;application/octet-stream&gt;
* @see #reqSpec for customise
* @param requiredFile (File) file to upload (required)
* @return operation
*/
public UploadFileWithRequiredFileOper requiredFileMultiPart(File requiredFile) {
reqSpec.addMultiPart(requiredFile);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public UploadFileWithRequiredFileOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public UploadFileWithRequiredFileOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
}

View File

@ -0,0 +1,390 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.Order;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.common.mapper.TypeRef;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.swagger.annotations.*;
import java.lang.reflect.Type;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.restassured.http.Method.*;
@Api(value = "Store")
public class StoreApi {
private Supplier<RequestSpecBuilder> reqSpecSupplier;
private Consumer<RequestSpecBuilder> reqSpecCustomizer;
private StoreApi(Supplier<RequestSpecBuilder> reqSpecSupplier) {
this.reqSpecSupplier = reqSpecSupplier;
}
public static StoreApi store(Supplier<RequestSpecBuilder> reqSpecSupplier) {
return new StoreApi(reqSpecSupplier);
}
private RequestSpecBuilder createReqSpec() {
RequestSpecBuilder reqSpec = reqSpecSupplier.get();
if(reqSpecCustomizer != null) {
reqSpecCustomizer.accept(reqSpec);
}
return reqSpec;
}
public List<Oper> getAllOperations() {
return Arrays.asList(
deleteOrder(),
getInventory(),
getOrderById(),
placeOrder()
);
}
@ApiOperation(value = "Delete purchase order by ID",
notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
nickname = "deleteOrder",
tags = { "store" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied") ,
@ApiResponse(code = 404, message = "Order not found") })
public DeleteOrderOper deleteOrder() {
return new DeleteOrderOper(createReqSpec());
}
@ApiOperation(value = "Returns pet inventories by status",
notes = "Returns a map of status codes to quantities",
nickname = "getInventory",
tags = { "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public GetInventoryOper getInventory() {
return new GetInventoryOper(createReqSpec());
}
@ApiOperation(value = "Find purchase order by ID",
notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
nickname = "getOrderById",
tags = { "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid ID supplied") ,
@ApiResponse(code = 404, message = "Order not found") })
public GetOrderByIdOper getOrderById() {
return new GetOrderByIdOper(createReqSpec());
}
@ApiOperation(value = "Place an order for a pet",
notes = "",
nickname = "placeOrder",
tags = { "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid Order") })
public PlaceOrderOper placeOrder() {
return new PlaceOrderOper(createReqSpec());
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return api
*/
public StoreApi reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
this.reqSpecCustomizer = reqSpecCustomizer;
return this;
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
* @see #orderIdPath ID of the order that needs to be deleted (required)
*/
public static class DeleteOrderOper implements Oper {
public static final Method REQ_METHOD = DELETE;
public static final String REQ_URI = "/store/order/{order_id}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public DeleteOrderOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* DELETE /store/order/{order_id}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
public static final String ORDER_ID_PATH = "order_id";
/**
* @param orderId (String) ID of the order that needs to be deleted (required)
* @return operation
*/
public DeleteOrderOper orderIdPath(Object orderId) {
reqSpec.addPathParam(ORDER_ID_PATH, orderId);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public DeleteOrderOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public DeleteOrderOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
*
* return Map&lt;String, Integer&gt;
*/
public static class GetInventoryOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/store/inventory";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public GetInventoryOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /store/inventory
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /store/inventory
* @param handler handler
* @return Map&lt;String, Integer&gt;
*/
public Map<String, Integer> executeAs(Function<Response, Response> handler) {
TypeRef<Map<String, Integer>> type = new TypeRef<Map<String, Integer>>(){};
return execute(handler).as(type);
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public GetInventoryOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public GetInventoryOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* @see #orderIdPath ID of pet that needs to be fetched (required)
* return Order
*/
public static class GetOrderByIdOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/store/order/{order_id}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public GetOrderByIdOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /store/order/{order_id}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /store/order/{order_id}
* @param handler handler
* @return Order
*/
public Order executeAs(Function<Response, Response> handler) {
TypeRef<Order> type = new TypeRef<Order>(){};
return execute(handler).as(type);
}
public static final String ORDER_ID_PATH = "order_id";
/**
* @param orderId (Long) ID of pet that needs to be fetched (required)
* @return operation
*/
public GetOrderByIdOper orderIdPath(Object orderId) {
reqSpec.addPathParam(ORDER_ID_PATH, orderId);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public GetOrderByIdOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public GetOrderByIdOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Place an order for a pet
*
*
* @see #body order placed for purchasing the pet (required)
* return Order
*/
public static class PlaceOrderOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/store/order";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public PlaceOrderOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("*/*");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /store/order
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* POST /store/order
* @param handler handler
* @return Order
*/
public Order executeAs(Function<Response, Response> handler) {
TypeRef<Order> type = new TypeRef<Order>(){};
return execute(handler).as(type);
}
/**
* @param body (Order) order placed for purchasing the pet (required)
* @return operation
*/
public PlaceOrderOper body(Order body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public PlaceOrderOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public PlaceOrderOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
}

View File

@ -0,0 +1,693 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.User;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.builder.ResponseSpecBuilder;
import io.restassured.common.mapper.TypeRef;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.swagger.annotations.*;
import java.lang.reflect.Type;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.restassured.http.Method.*;
@Api(value = "User")
public class UserApi {
private Supplier<RequestSpecBuilder> reqSpecSupplier;
private Consumer<RequestSpecBuilder> reqSpecCustomizer;
private UserApi(Supplier<RequestSpecBuilder> reqSpecSupplier) {
this.reqSpecSupplier = reqSpecSupplier;
}
public static UserApi user(Supplier<RequestSpecBuilder> reqSpecSupplier) {
return new UserApi(reqSpecSupplier);
}
private RequestSpecBuilder createReqSpec() {
RequestSpecBuilder reqSpec = reqSpecSupplier.get();
if(reqSpecCustomizer != null) {
reqSpecCustomizer.accept(reqSpec);
}
return reqSpec;
}
public List<Oper> getAllOperations() {
return Arrays.asList(
createUser(),
createUsersWithArrayInput(),
createUsersWithListInput(),
deleteUser(),
getUserByName(),
loginUser(),
logoutUser(),
updateUser()
);
}
@ApiOperation(value = "Create user",
notes = "This can only be done by the logged in user.",
nickname = "createUser",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 0, message = "successful operation") })
public CreateUserOper createUser() {
return new CreateUserOper(createReqSpec());
}
@ApiOperation(value = "Creates list of users with given input array",
notes = "",
nickname = "createUsersWithArrayInput",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 0, message = "successful operation") })
public CreateUsersWithArrayInputOper createUsersWithArrayInput() {
return new CreateUsersWithArrayInputOper(createReqSpec());
}
@ApiOperation(value = "Creates list of users with given input array",
notes = "",
nickname = "createUsersWithListInput",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 0, message = "successful operation") })
public CreateUsersWithListInputOper createUsersWithListInput() {
return new CreateUsersWithListInputOper(createReqSpec());
}
@ApiOperation(value = "Delete user",
notes = "This can only be done by the logged in user.",
nickname = "deleteUser",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid username supplied") ,
@ApiResponse(code = 404, message = "User not found") })
public DeleteUserOper deleteUser() {
return new DeleteUserOper(createReqSpec());
}
@ApiOperation(value = "Get user by user name",
notes = "",
nickname = "getUserByName",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid username supplied") ,
@ApiResponse(code = 404, message = "User not found") })
public GetUserByNameOper getUserByName() {
return new GetUserByNameOper(createReqSpec());
}
@ApiOperation(value = "Logs user into the system",
notes = "",
nickname = "loginUser",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") ,
@ApiResponse(code = 400, message = "Invalid username/password supplied") })
public LoginUserOper loginUser() {
return new LoginUserOper(createReqSpec());
}
@ApiOperation(value = "Logs out current logged in user session",
notes = "",
nickname = "logoutUser",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 0, message = "successful operation") })
public LogoutUserOper logoutUser() {
return new LogoutUserOper(createReqSpec());
}
@ApiOperation(value = "Updated user",
notes = "This can only be done by the logged in user.",
nickname = "updateUser",
tags = { "user" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid user supplied") ,
@ApiResponse(code = 404, message = "User not found") })
public UpdateUserOper updateUser() {
return new UpdateUserOper(createReqSpec());
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return api
*/
public UserApi reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
this.reqSpecCustomizer = reqSpecCustomizer;
return this;
}
/**
* Create user
* This can only be done by the logged in user.
*
* @see #body Created user object (required)
*/
public static class CreateUserOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/user";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public CreateUserOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("*/*");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /user
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (User) Created user object (required)
* @return operation
*/
public CreateUserOper body(User body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public CreateUserOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public CreateUserOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Creates list of users with given input array
*
*
* @see #body List of user object (required)
*/
public static class CreateUsersWithArrayInputOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/user/createWithArray";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public CreateUsersWithArrayInputOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("*/*");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /user/createWithArray
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (List&lt;User&gt;) List of user object (required)
* @return operation
*/
public CreateUsersWithArrayInputOper body(List<User> body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public CreateUsersWithArrayInputOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public CreateUsersWithArrayInputOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Creates list of users with given input array
*
*
* @see #body List of user object (required)
*/
public static class CreateUsersWithListInputOper implements Oper {
public static final Method REQ_METHOD = POST;
public static final String REQ_URI = "/user/createWithList";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public CreateUsersWithListInputOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("*/*");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* POST /user/createWithList
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (List&lt;User&gt;) List of user object (required)
* @return operation
*/
public CreateUsersWithListInputOper body(List<User> body) {
reqSpec.setBody(body);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public CreateUsersWithListInputOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public CreateUsersWithListInputOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Delete user
* This can only be done by the logged in user.
*
* @see #usernamePath The name that needs to be deleted (required)
*/
public static class DeleteUserOper implements Oper {
public static final Method REQ_METHOD = DELETE;
public static final String REQ_URI = "/user/{username}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public DeleteUserOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* DELETE /user/{username}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
public static final String USERNAME_PATH = "username";
/**
* @param username (String) The name that needs to be deleted (required)
* @return operation
*/
public DeleteUserOper usernamePath(Object username) {
reqSpec.addPathParam(USERNAME_PATH, username);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public DeleteUserOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public DeleteUserOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Get user by user name
*
*
* @see #usernamePath The name that needs to be fetched. Use user1 for testing. (required)
* return User
*/
public static class GetUserByNameOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/user/{username}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public GetUserByNameOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /user/{username}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /user/{username}
* @param handler handler
* @return User
*/
public User executeAs(Function<Response, Response> handler) {
TypeRef<User> type = new TypeRef<User>(){};
return execute(handler).as(type);
}
public static final String USERNAME_PATH = "username";
/**
* @param username (String) The name that needs to be fetched. Use user1 for testing. (required)
* @return operation
*/
public GetUserByNameOper usernamePath(Object username) {
reqSpec.addPathParam(USERNAME_PATH, username);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public GetUserByNameOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public GetUserByNameOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Logs user into the system
*
*
* @see #usernameQuery The user name for login (required)
* @see #passwordQuery The password for login in clear text (required)
* return String
*/
public static class LoginUserOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/user/login";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public LoginUserOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /user/login
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* GET /user/login
* @param handler handler
* @return String
*/
public String executeAs(Function<Response, Response> handler) {
TypeRef<String> type = new TypeRef<String>(){};
return execute(handler).as(type);
}
public static final String USERNAME_QUERY = "username";
/**
* @param username (String) The user name for login (required)
* @return operation
*/
public LoginUserOper usernameQuery(Object... username) {
reqSpec.addQueryParam(USERNAME_QUERY, username);
return this;
}
public static final String PASSWORD_QUERY = "password";
/**
* @param password (String) The password for login in clear text (required)
* @return operation
*/
public LoginUserOper passwordQuery(Object... password) {
reqSpec.addQueryParam(PASSWORD_QUERY, password);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public LoginUserOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public LoginUserOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Logs out current logged in user session
*
*
*/
public static class LogoutUserOper implements Oper {
public static final Method REQ_METHOD = GET;
public static final String REQ_URI = "/user/logout";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public LogoutUserOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* GET /user/logout
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public LogoutUserOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public LogoutUserOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
/**
* Updated user
* This can only be done by the logged in user.
*
* @see #usernamePath name that need to be deleted (required)
* @see #body Updated user object (required)
*/
public static class UpdateUserOper implements Oper {
public static final Method REQ_METHOD = PUT;
public static final String REQ_URI = "/user/{username}";
private RequestSpecBuilder reqSpec;
private ResponseSpecBuilder respSpec;
public UpdateUserOper(RequestSpecBuilder reqSpec) {
this.reqSpec = reqSpec;
reqSpec.setContentType("*/*");
reqSpec.setAccept("application/json");
this.respSpec = new ResponseSpecBuilder();
}
/**
* PUT /user/{username}
* @param handler handler
* @param <T> type
* @return type
*/
@Override
public <T> T execute(Function<Response, T> handler) {
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI));
}
/**
* @param body (User) Updated user object (required)
* @return operation
*/
public UpdateUserOper body(User body) {
reqSpec.setBody(body);
return this;
}
public static final String USERNAME_PATH = "username";
/**
* @param username (String) name that need to be deleted (required)
* @return operation
*/
public UpdateUserOper usernamePath(Object username) {
reqSpec.addPathParam(USERNAME_PATH, username);
return this;
}
/**
* Customize request specification
* @param reqSpecCustomizer consumer to modify the RequestSpecBuilder
* @return operation
*/
public UpdateUserOper reqSpec(Consumer<RequestSpecBuilder> reqSpecCustomizer) {
reqSpecCustomizer.accept(reqSpec);
return this;
}
/**
* Customize response specification
* @param respSpecCustomizer consumer to modify the ResponseSpecBuilder
* @return operation
*/
public UpdateUserOper respSpec(Consumer<ResponseSpecBuilder> respSpecCustomizer) {
respSpecCustomizer.accept(respSpec);
return this;
}
}
}

View File

@ -0,0 +1,109 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesAnyType
*/
@JsonPropertyOrder({
AdditionalPropertiesAnyType.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesAnyType name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesAnyType {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,110 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesArray
*/
@JsonPropertyOrder({
AdditionalPropertiesArray.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesArray extends HashMap<String, List> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesArray name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
return Objects.equals(this.name, additionalPropertiesArray.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesArray {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,109 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesBoolean
*/
@JsonPropertyOrder({
AdditionalPropertiesBoolean.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesBoolean name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesBoolean {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,491 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesClass
*/
@JsonPropertyOrder({
AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING,
AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE,
AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1,
AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2,
AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3
})
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
private Map<String, String> mapString = null;
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
private Map<String, BigDecimal> mapNumber = null;
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
private Map<String, Integer> mapInteger = null;
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
private Map<String, Boolean> mapBoolean = null;
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
private Map<String, List<Integer>> mapArrayInteger = null;
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
private Map<String, List<Object>> mapArrayAnytype = null;
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
private Map<String, Map<String, String>> mapMapString = null;
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
private Map<String, Map<String, Object>> mapMapAnytype = null;
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
private Object anytype1;
public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2";
private Object anytype2;
public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3";
private Object anytype3;
public AdditionalPropertiesClass mapString(Map<String, String> mapString) {
this.mapString = mapString;
return this;
}
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
}
/**
* Get mapString
* @return mapString
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, String> getMapString() {
return mapString;
}
public void setMapString(Map<String, String> mapString) {
this.mapString = mapString;
}
public AdditionalPropertiesClass mapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
return this;
}
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
/**
* Get mapNumber
* @return mapNumber
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, BigDecimal> getMapNumber() {
return mapNumber;
}
public void setMapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
}
public AdditionalPropertiesClass mapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
return this;
}
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
/**
* Get mapInteger
* @return mapInteger
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_INTEGER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, Integer> getMapInteger() {
return mapInteger;
}
public void setMapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
}
public AdditionalPropertiesClass mapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
return this;
}
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
/**
* Get mapBoolean
* @return mapBoolean
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, Boolean> getMapBoolean() {
return mapBoolean;
}
public void setMapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
}
public AdditionalPropertiesClass mapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
return this;
}
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
/**
* Get mapArrayInteger
* @return mapArrayInteger
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, List<Integer>> getMapArrayInteger() {
return mapArrayInteger;
}
public void setMapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
}
public AdditionalPropertiesClass mapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
return this;
}
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
/**
* Get mapArrayAnytype
* @return mapArrayAnytype
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, List<Object>> getMapArrayAnytype() {
return mapArrayAnytype;
}
public void setMapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
}
public AdditionalPropertiesClass mapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
return this;
}
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
/**
* Get mapMapString
* @return mapMapString
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, Map<String, String>> getMapMapString() {
return mapMapString;
}
public void setMapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
}
public AdditionalPropertiesClass mapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
return this;
}
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}
/**
* Get mapMapAnytype
* @return mapMapAnytype
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, Map<String, Object>> getMapMapAnytype() {
return mapMapAnytype;
}
public void setMapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
}
public AdditionalPropertiesClass anytype1(Object anytype1) {
this.anytype1 = anytype1;
return this;
}
/**
* Get anytype1
* @return anytype1
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_ANYTYPE1)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Object getAnytype1() {
return anytype1;
}
public void setAnytype1(Object anytype1) {
this.anytype1 = anytype1;
}
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
return this;
}
/**
* Get anytype2
* @return anytype2
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_ANYTYPE2)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Object getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
this.anytype2 = anytype2;
}
public AdditionalPropertiesClass anytype3(Object anytype3) {
this.anytype3 = anytype3;
return this;
}
/**
* Get anytype3
* @return anytype3
**/
@javax.annotation.Nullable
@Valid
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_ANYTYPE3)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Object getAnytype3() {
return anytype3;
}
public void setAnytype3(Object anytype3) {
this.anytype3 = anytype3;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapString, additionalPropertiesClass.mapString) &&
Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) &&
Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) &&
Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) &&
Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) &&
Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) &&
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n");
sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n");
sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n");
sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n");
sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n");
sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n");
sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n");
sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n");
sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n");
sb.append(" anytype3: ").append(toIndentedString(anytype3)).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,109 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesInteger
*/
@JsonPropertyOrder({
AdditionalPropertiesInteger.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesInteger name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
return Objects.equals(this.name, additionalPropertiesInteger.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesInteger {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,110 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesNumber
*/
@JsonPropertyOrder({
AdditionalPropertiesNumber.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesNumber name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
return Objects.equals(this.name, additionalPropertiesNumber.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesNumber {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,109 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesObject
*/
@JsonPropertyOrder({
AdditionalPropertiesObject.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesObject extends HashMap<String, Map> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesObject name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
return Objects.equals(this.name, additionalPropertiesObject.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesObject {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,109 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.validation.constraints.*;
import javax.validation.Valid;
import org.hibernate.validator.constraints.*;
/**
* AdditionalPropertiesString
*/
@JsonPropertyOrder({
AdditionalPropertiesString.JSON_PROPERTY_NAME
})
public class AdditionalPropertiesString extends HashMap<String, String> {
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public AdditionalPropertiesString name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
return Objects.equals(this.name, additionalPropertiesString.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesString {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

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