diff --git a/pom.xml b/pom.xml
index 3ebd8f5b5d..dfa7e09acc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -125,6 +125,7 @@
rest-testingresteasyrxjava
+ spring-swagger-codegenselenium-junit-testngsolr
diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml
new file mode 100644
index 0000000000..79e244d2db
--- /dev/null
+++ b/spring-swagger-codegen/pom.xml
@@ -0,0 +1,12 @@
+
+ 4.0.0
+ com.baeldung
+ spring-swagger-codegen
+ 0.0.1-SNAPSHOT
+ pom
+
+ spring-swagger-codegen-api-client
+ spring-swagger-codegen-app
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/.gitignore b/spring-swagger-codegen/spring-swagger-codegen-api-client/.gitignore
new file mode 100644
index 0000000000..a530464afa
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/.gitignore
@@ -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
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen-ignore b/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen-ignore
new file mode 100644
index 0000000000..c5fa491b4c
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen/VERSION b/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen/VERSION
new file mode 100644
index 0000000000..6b4d157738
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/.swagger-codegen/VERSION
@@ -0,0 +1 @@
+2.2.3
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/.travis.yml b/spring-swagger-codegen/spring-swagger-codegen-api-client/.travis.yml
new file mode 100644
index 0000000000..70cb81a67c
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/.travis.yml
@@ -0,0 +1,17 @@
+#
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+language: java
+jdk:
+ - oraclejdk8
+ - oraclejdk7
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ - mvn test
+ # uncomment below to test using gradle
+ # - gradle test
+ # uncomment below to test using sbt
+ # - sbt test
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/README.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/README.md
new file mode 100644
index 0000000000..b1b7a63a9c
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/README.md
@@ -0,0 +1,155 @@
+# spring-swagger-codegen-api-client
+
+## Requirements
+
+Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn deploy
+```
+
+Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ com.baeldung
+ spring-swagger-codegen-api-client
+ 0.0.1-SNAPSHOT
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+compile "com.baeldung:spring-swagger-codegen-api-client:0.0.1-SNAPSHOT"
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+ mvn package
+
+Then manually install the following JARs:
+
+* target/spring-swagger-codegen-api-client-0.0.1-SNAPSHOT.jar
+* target/lib/*.jar
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+import com.baeldung.petstore.client.invoker.*;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.model.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+import java.io.File;
+import java.util.*;
+
+public class PetApiExample {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi();
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [Category](docs/Category.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [Order](docs/Order.md)
+ - [Pet](docs/Pet.md)
+ - [Tag](docs/Tag.md)
+ - [User](docs/User.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+apiteam@swagger.io
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/build.gradle b/spring-swagger-codegen/spring-swagger-codegen-api-client/build.gradle
new file mode 100644
index 0000000000..36716a3436
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/build.gradle
@@ -0,0 +1,114 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+
+group = 'com.baeldung'
+version = '0.0.1-SNAPSHOT'
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
+ }
+}
+
+repositories {
+ jcenter()
+}
+
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 23
+ buildToolsVersion '23.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 22
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:jsr250-api:1.0'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+
+ sourceCompatibility = JavaVersion.VERSION_1_7
+ targetCompatibility = JavaVersion.VERSION_1_7
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'spring-swagger-codegen-api-client'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.5.15"
+ jackson_version = "2.8.9"
+ spring_web_version = "4.3.9.RELEASE"
+ jodatime_version = "2.9.9"
+ junit_version = "4.12"
+}
+
+dependencies {
+ compile "io.swagger:swagger-annotations:$swagger_annotations_version"
+ compile "org.springframework:spring-web:$spring_web_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_version"
+ compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
+ compile "joda-time:joda-time:$jodatime_version"
+ testCompile "junit:junit:$junit_version"
+}
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/build.sbt b/spring-swagger-codegen/spring-swagger-codegen-api-client/build.sbt
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Category.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Category.md
new file mode 100644
index 0000000000..e2df080327
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Category.md
@@ -0,0 +1,11 @@
+
+# Category
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/ModelApiResponse.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/ModelApiResponse.md
new file mode 100644
index 0000000000..3eec8686cc
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/ModelApiResponse.md
@@ -0,0 +1,12 @@
+
+# ModelApiResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Order.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Order.md
new file mode 100644
index 0000000000..a1089f5384
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Order.md
@@ -0,0 +1,24 @@
+
+# Order
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | [**DateTime**](DateTime.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Pet.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Pet.md
new file mode 100644
index 0000000000..5b63109ef9
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Pet.md
@@ -0,0 +1,24 @@
+
+# Pet
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **List<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/PetApi.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/PetApi.md
new file mode 100644
index 0000000000..c81b8d014c
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/PetApi.md
@@ -0,0 +1,448 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io/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
+
+
+
+# **addPet**
+> addPet(body)
+
+Add a new pet to the store
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.addPet(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: application/xml, application/json
+
+
+# **deletePet**
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | Pet id to delete
+String apiKey = "apiKey_example"; // String |
+try {
+ apiInstance.deletePet(petId, apiKey);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **findPetsByStatus**
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter
+try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **findPetsByTags**
+> List<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List tags = Arrays.asList("tags_example"); // List | Tags to filter by
+try {
+ List result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getPetById**
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet to return
+try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **updatePet**
+> updatePet(body)
+
+Update an existing pet
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.updatePet(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: application/xml, application/json
+
+
+# **updatePetWithForm**
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet that needs to be updated
+String name = "name_example"; // String | Updated name of the pet
+String status = "status_example"; // String | Updated status of the pet
+try {
+ apiInstance.updatePetWithForm(petId, name, status);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: application/xml, application/json
+
+
+# **uploadFile**
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet to update
+String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+File file = new File("/path/to/file.txt"); // File | file to upload
+try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **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
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/StoreApi.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/StoreApi.md
new file mode 100644
index 0000000000..7beaa75b86
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/StoreApi.md
@@ -0,0 +1,197 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+# **deleteOrder**
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Long orderId = 789L; // Long | ID of the order that needs to be deleted
+try {
+ apiInstance.deleteOrder(orderId);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getInventory**
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiClient;
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.invoker.Configuration;
+//import com.baeldung.petstore.client.invoker.auth.*;
+//import com.baeldung.petstore.client.api.StoreApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+StoreApi apiInstance = new StoreApi();
+try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**Map<String, Integer>**](Map.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **getOrderById**
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Long orderId = 789L; // Long | ID of pet that needs to be fetched
+try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **placeOrder**
+> Order placeOrder(body)
+
+Place an order for a pet
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Order body = new Order(); // Order | order placed for purchasing the pet
+try {
+ Order result = apiInstance.placeOrder(body);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ e.printStackTrace();
+}
+```
+
+### 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
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Tag.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Tag.md
new file mode 100644
index 0000000000..de6814b55d
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/Tag.md
@@ -0,0 +1,11 @@
+
+# Tag
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/User.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/User.md
new file mode 100644
index 0000000000..8b6753dd28
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/User.md
@@ -0,0 +1,17 @@
+
+# User
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/UserApi.md b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/UserApi.md
new file mode 100644
index 0000000000..bc5733b201
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/docs/UserApi.md
@@ -0,0 +1,370 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io/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
+
+
+
+# **createUser**
+> createUser(body)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+User body = new User(); // User | Created user object
+try {
+ apiInstance.createUser(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **createUsersWithArrayInput**
+> createUsersWithArrayInput(body)
+
+Creates list of users with given input array
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List body = Arrays.asList(new User()); // List | List of user object
+try {
+ apiInstance.createUsersWithArrayInput(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **createUsersWithListInput**
+> createUsersWithListInput(body)
+
+Creates list of users with given input array
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List body = Arrays.asList(new User()); // List | List of user object
+try {
+ apiInstance.createUsersWithListInput(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **deleteUser**
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be deleted
+try {
+ apiInstance.deleteUser(username);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getUserByName**
+> User getUserByName(username)
+
+Get user by user name
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **loginUser**
+> String loginUser(username, password)
+
+Logs user into the system
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The user name for login
+String password = "password_example"; // String | The password for login in clear text
+try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **logoutUser**
+> logoutUser()
+
+Logs out current logged in user session
+
+
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+try {
+ apiInstance.logoutUser();
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **updateUser**
+> updateUser(username, body)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import com.baeldung.petstore.client.invoker.ApiException;
+//import com.baeldung.petstore.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | name that need to be updated
+User body = new User(); // User | Updated user object
+try {
+ apiInstance.updateUser(username, body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be updated |
+ **body** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/git_push.sh b/spring-swagger-codegen/spring-swagger-codegen-api-client/git_push.sh
new file mode 100644
index 0000000000..ed374619b1
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/git_push.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle.properties b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle.properties
new file mode 100644
index 0000000000..05644f0754
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle.properties
@@ -0,0 +1,2 @@
+# Uncomment to build for Android
+#target = android
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.jar b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..2c6137b878
Binary files /dev/null and b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.properties b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..b7a3647395
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:08:05 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew
new file mode 100644
index 0000000000..9d82f78915
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew.bat b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew.bat
new file mode 100644
index 0000000000..5f192121eb
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml
new file mode 100644
index 0000000000..fb25a888fd
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml
@@ -0,0 +1,243 @@
+
+ 4.0.0
+ com.baeldung
+ spring-swagger-codegen-api-client
+ jar
+ spring-swagger-codegen-api-client
+ 0.0.1-SNAPSHOT
+ https://github.com/swagger-api/swagger-codegen
+ Swagger Java
+
+ scm:git:git@github.com:swagger-api/swagger-codegen.git
+ scm:git:git@github.com:swagger-api/swagger-codegen.git
+ https://github.com/swagger-api/swagger-codegen
+
+
+ 2.2.0
+
+
+
+
+ Unlicense
+ http://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ Swagger
+ apiteam@swagger.io
+ Swagger
+ http://swagger.io
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.12
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ pertest
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.2
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.10
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+ src/main/java
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+ 1.7
+ 1.7
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.10.4
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+ org.springframework
+ spring-web
+ ${spring-web-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
+
+ joda-time
+ joda-time
+ ${jodatime-version}
+
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.5.15
+ 4.3.9.RELEASE
+ 2.8.9
+ 2.9.9
+ 1.0.0
+ 4.12
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/settings.gradle b/spring-swagger-codegen/spring-swagger-codegen-api-client/settings.gradle
new file mode 100644
index 0000000000..3687afd41a
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "spring-swagger-codegen-api-client"
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/AndroidManifest.xml b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..cd581f9f78
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java
new file mode 100644
index 0000000000..04f37b4235
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java
@@ -0,0 +1,367 @@
+package com.baeldung.petstore.client.api;
+
+import com.baeldung.petstore.client.invoker.ApiClient;
+
+import java.io.File;
+import com.baeldung.petstore.client.model.ModelApiResponse;
+import com.baeldung.petstore.client.model.Pet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-29T12:04:37.072+02:00")
+@Component("com.baeldung.petstore.client.api.PetApi")
+public class PetApi {
+ private ApiClient apiClient;
+
+ public PetApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public PetApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ *
405 - Invalid input
+ * @param body Pet object that needs to be added to the store
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void addPet(Pet body) throws RestClientException {
+ Object postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json", "application/xml"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Deletes a pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId Pet id to delete
+ * @param apiKey The apiKey parameter
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void deletePet(Long petId, String apiKey) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (apiKey != null)
+ headerParams.add("api_key", apiClient.parameterToString(apiKey));
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
200 - successful operation
+ *
400 - Invalid status value
+ * @param status Status values that need to be considered for filter
+ * @return List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public List findPetsByStatus(List status) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase()), "status", status));
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Finds Pets by tags
+ * Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
200 - successful operation
+ *
400 - Invalid tag value
+ * @param tags Tags to filter by
+ * @return List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public List findPetsByTags(List tags) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase()), "tags", tags));
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ *
200 - successful operation
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId ID of pet to return
+ * @return Pet
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Pet getPetById(Long petId) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling getPetById");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "api_key" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Update an existing pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ *
405 - Validation exception
+ * @param body Pet object that needs to be added to the store
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void updatePet(Pet body) throws RestClientException {
+ Object postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json", "application/xml"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Updates a pet in the store with form data
+ *
+ *
405 - Invalid input
+ * @param petId ID of pet that needs to be updated
+ * @param name Updated name of the pet
+ * @param status Updated status of the pet
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void updatePetWithForm(Long petId, String name, String status) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling updatePetWithForm");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (name != null)
+ formParams.add("name", name);
+ if (status != null)
+ formParams.add("status", status);
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * uploads an image
+ *
+ *
200 - successful operation
+ * @param petId ID of pet to update
+ * @param additionalMetadata Additional data to pass to server
+ * @param file file to upload
+ * @return ModelApiResponse
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFile");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (additionalMetadata != null)
+ formParams.add("additionalMetadata", additionalMetadata);
+ if (file != null)
+ formParams.add("file", new FileSystemResource(file));
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "multipart/form-data"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+}
diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java
new file mode 100644
index 0000000000..040830f334
--- /dev/null
+++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java
@@ -0,0 +1,187 @@
+package com.baeldung.petstore.client.api;
+
+import com.baeldung.petstore.client.invoker.ApiClient;
+
+import com.baeldung.petstore.client.model.Order;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+
+@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-29T12:04:37.072+02:00")
+@Component("com.baeldung.petstore.client.api.StoreApi")
+public class StoreApi {
+ private ApiClient apiClient;
+
+ public StoreApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public StoreApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+ *
400 - Invalid ID supplied
+ *
404 - Order not found
+ * @param orderId ID of the order that needs to be deleted
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void deleteOrder(Long orderId) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling deleteOrder");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("orderId", orderId);
+ String path = UriComponentsBuilder.fromPath("/store/order/{orderId}").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
200 - successful operation
+ * @return Map<String, Integer>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Map getInventory() throws RestClientException {
+ Object postBody = null;
+
+ String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "api_key" };
+
+ ParameterizedTypeReference