diff --git a/bin/windows/android-petstore-all.bat b/bin/windows/android-petstore-all.bat
new file mode 100755
index 0000000000..65862f5f0b
--- /dev/null
+++ b/bin/windows/android-petstore-all.bat
@@ -0,0 +1,2 @@
+call .\bin\windows\android-petstore-volley.bat
+call .\bin\windows\android-petstore-httpclient.bat
diff --git a/bin/windows/android-petstore-httpclient.bat b/bin/windows/android-petstore-httpclient.bat
new file mode 100755
index 0000000000..a31eb334ef
--- /dev/null
+++ b/bin/windows/android-petstore-httpclient.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l android -o samples\client\petstore\android\httpclient-Dlibrary=httpclient
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/bin/windows/android-petstore-volley.bat b/bin/windows/android-petstore-volley.bat
new file mode 100755
index 0000000000..94db84cc90
--- /dev/null
+++ b/bin/windows/android-petstore-volley.bat
@@ -0,0 +1,10 @@
+set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
+
+If Not Exist %executable% (
+ mvn clean package
+)
+
+REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
+set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l android -o samples\client\petstore\android\volley
+
+java %JAVA_OPTS% -jar %executable% %ags%
diff --git a/modules/swagger-codegen/src/main/resources/android/api.mustache b/modules/swagger-codegen/src/main/resources/android/api.mustache
index 5d8cdd330d..44e96c63fc 100644
--- a/modules/swagger-codegen/src/main/resources/android/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/api.mustache
@@ -48,12 +48,14 @@ public class {{classname}} {
*/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
- {{#allParams}}{{#required}}
+ {{#allParams}}
+ {{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{nickname}}");
}
- {{/required}}{{/allParams}}
+ {{/required}}
+ {{/allParams}}
// create path and map variables
String localVarPath = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}};
diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
index 7aa3bef653..97c7c92ce6 100644
--- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/api.mustache
@@ -127,15 +127,15 @@ public class {{classname}} {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -147,13 +147,15 @@ public class {{classname}} {
public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}, {{/hasMore}}{{/allParams}}final Response.Listener<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}String{{/returnType}}> responseListener, final Response.ErrorListener errorListener) {
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
- {{#allParams}}{{#required}}
+ {{#allParams}}
+ {{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
- VolleyError error = new VolleyError("Missing the required parameter '{{paramName}}' when calling {{nickname}}",
- new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{nickname}}"));
+ VolleyError error = new VolleyError("Missing the required parameter '{{paramName}}' when calling {{nickname}}",
+ new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{nickname}}"));
}
- {{/required}}{{/allParams}}
+ {{/required}}
+ {{/allParams}}
// create path and map variables
String path = "{{{path}}}".replaceAll("\\{format\\}","json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", apiInvoker.escapeString({{{paramName}}}.toString())){{/pathParams}};
@@ -199,7 +201,7 @@ public class {{classname}} {
{{/formParams}}
}
- String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
+ String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
try {
apiInvoker.invokeAPI(basePath, path, "{{httpMethod}}", queryParams, postBody, headerParams, formParams, contentType, authNames,
diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json
index be0254ec3a..f498d308ba 100644
--- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json
+++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json
@@ -1,4 +1,3 @@
-
{
"swagger": "2.0",
"info": {
diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml
index e3ba184ea5..692689565d 100644
--- a/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml
+++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml
@@ -1,29 +1,20 @@
swagger: '2.0'
info:
- description: 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'
+ description: >-
+ This is a sample server Petstore server. You can find out more about
+ Swagger at http://swagger.io or on
+ irc.freenode.net, #swagger. For this sample, you can use the api key
+ "special-key" to test the authorization filters
version: 1.0.0
title: Swagger Petstore
- termsOfService: 'http://swagger.io/terms/'
+ termsOfService: 'http://helloreverb.com/terms/'
contact:
- email: apiteam@swagger.io
+ email: apiteam@wordnik.com
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2
-tags:
- - name: pet
- description: Everything about your Pets
- externalDocs:
- description: Find out more
- url: 'http://swagger.io'
- - name: store
- description: Access to Petstore orders
- - name: user
- description: Operations about user
- externalDocs:
- description: Find out more about our store
- url: 'http://swagger.io'
schemes:
- http
paths:
@@ -38,13 +29,13 @@ paths:
- application/json
- application/xml
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: Pet object that needs to be added to the store
- required: true
+ required: false
schema:
$ref: '#/definitions/Pet'
responses:
@@ -64,13 +55,13 @@ paths:
- application/json
- application/xml
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: Pet object that needs to be added to the store
- required: true
+ required: false
schema:
$ref: '#/definitions/Pet'
responses:
@@ -92,13 +83,13 @@ paths:
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
- required: true
+ required: false
type: array
items:
type: string
@@ -106,8 +97,8 @@ paths:
- available
- pending
- sold
- default: available
- collectionFormat: csv
+ collectionFormat: multi
+ default: available
responses:
'200':
description: successful operation
@@ -115,6 +106,13 @@ paths:
type: array
items:
$ref: '#/definitions/Pet'
+ examples:
+ application/json:
+ name: Puma
+ type: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
'400':
description: Invalid status value
security:
@@ -126,20 +124,22 @@ paths:
tags:
- pet
summary: Finds Pets by tags
- description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.'
+ description: >-
+ Multiple tags can be provided with comma separated strings. Use tag1,
+ tag2, tag3 for testing.
operationId: findPetsByTags
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: tags
in: query
description: Tags to filter by
- required: true
+ required: false
type: array
items:
type: string
- collectionFormat: csv
+ collectionFormat: multi
responses:
'200':
description: successful operation
@@ -158,15 +158,17 @@ paths:
tags:
- pet
summary: Find pet by ID
- description: Returns a single pet
+ description: >-
+ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API
+ error conditions
operationId: getPetById
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: petId
in: path
- description: ID of pet to return
+ description: ID of pet that needs to be fetched
required: true
type: integer
format: int64
@@ -181,6 +183,9 @@ paths:
description: Pet not found
security:
- api_key: []
+ - petstore_auth:
+ - 'write:pets'
+ - 'read:pets'
post:
tags:
- pet
@@ -190,15 +195,14 @@ paths:
consumes:
- application/x-www-form-urlencoded
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: petId
in: path
description: ID of pet that needs to be updated
required: true
- type: integer
- format: int64
+ type: string
- name: name
in: formData
description: Updated name of the pet
@@ -223,11 +227,12 @@ paths:
description: ''
operationId: deletePet
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: api_key
in: header
+ description: ''
required: false
type: string
- name: petId
@@ -254,6 +259,7 @@ paths:
- multipart/form-data
produces:
- application/json
+ - application/xml
parameters:
- name: petId
in: path
@@ -272,10 +278,8 @@ paths:
required: false
type: file
responses:
- '200':
+ default:
description: successful operation
- schema:
- $ref: '#/definitions/ApiResponse'
security:
- petstore_auth:
- 'write:pets'
@@ -289,7 +293,7 @@ paths:
operationId: getInventory
produces:
- application/json
- parameters: []
+ - application/xml
responses:
'200':
description: successful operation
@@ -308,13 +312,13 @@ paths:
description: ''
operationId: placeOrder
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: order placed for purchasing the pet
- required: true
+ required: false
schema:
$ref: '#/definitions/Order'
responses:
@@ -329,20 +333,19 @@ paths:
tags:
- store
summary: Find purchase order by ID
- description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions'
+ description: >-
+ For valid response try integer IDs with value <= 5 or > 10. Other values
+ will generated exceptions
operationId: getOrderById
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: orderId
in: path
description: ID of pet that needs to be fetched
required: true
- type: integer
- maximum: 5
- minimum: 1
- format: int64
+ type: string
responses:
'200':
description: successful operation
@@ -356,11 +359,13 @@ paths:
tags:
- store
summary: Delete purchase order by ID
- description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ description: >-
+ For valid response try integer IDs with value < 1000. Anything above
+ 1000 or nonintegers will generate API errors
operationId: deleteOrder
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: orderId
in: path
@@ -380,13 +385,13 @@ paths:
description: This can only be done by the logged in user.
operationId: createUser
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: Created user object
- required: true
+ required: false
schema:
$ref: '#/definitions/User'
responses:
@@ -400,13 +405,13 @@ paths:
description: ''
operationId: createUsersWithArrayInput
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: List of user object
- required: true
+ required: false
schema:
type: array
items:
@@ -422,13 +427,13 @@ paths:
description: ''
operationId: createUsersWithListInput
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- in: body
name: body
description: List of user object
- required: true
+ required: false
schema:
type: array
items:
@@ -444,33 +449,24 @@ paths:
description: ''
operationId: loginUser
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: username
in: query
description: The user name for login
- required: true
+ required: false
type: string
- name: password
in: query
description: The password for login in clear text
- required: true
+ required: false
type: string
responses:
'200':
description: successful operation
schema:
type: string
- headers:
- X-Rate-Limit:
- type: integer
- format: int32
- description: calls per hour allowed by the user
- X-Expires-After:
- type: string
- format: date-time
- description: date in UTC when toekn expires
'400':
description: Invalid username/password supplied
/user/logout:
@@ -481,9 +477,8 @@ paths:
description: ''
operationId: logoutUser
produces:
- - application/xml
- application/json
- parameters: []
+ - application/xml
responses:
default:
description: successful operation
@@ -495,8 +490,8 @@ paths:
description: ''
operationId: getUserByName
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: username
in: path
@@ -519,8 +514,8 @@ paths:
description: This can only be done by the logged in user.
operationId: updateUser
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: username
in: path
@@ -530,7 +525,7 @@ paths:
- in: body
name: body
description: Updated user object
- required: true
+ required: false
schema:
$ref: '#/definitions/User'
responses:
@@ -545,8 +540,8 @@ paths:
description: This can only be done by the logged in user.
operationId: deleteUser
produces:
- - application/xml
- application/json
+ - application/xml
parameters:
- name: username
in: path
@@ -559,6 +554,10 @@ paths:
'404':
description: User not found
securityDefinitions:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
petstore_auth:
type: oauth2
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
@@ -566,56 +565,8 @@ securityDefinitions:
scopes:
'write:pets': modify pets in your account
'read:pets': read your pets
- api_key:
- type: apiKey
- name: api_key
- in: header
definitions:
- Order:
- title: Pet Order
- description: An order for a pets from the pet store
- type: object
- properties:
- id:
- type: integer
- format: int64
- petId:
- type: integer
- format: int64
- quantity:
- type: integer
- format: int32
- shipDate:
- type: string
- format: date-time
- status:
- type: string
- description: Order Status
- enum:
- - placed
- - approved
- - delivered
- complete:
- type: boolean
- default: false
- xml:
- name: Order
- Category:
- title: Pet catehgry
- description: A category for a pet
- type: object
- properties:
- id:
- type: integer
- format: int64
- name:
- type: string
- xml:
- name: Category
User:
- title: a User
- description: A User who is purchasing from the pet store
- type: object
properties:
id:
type: integer
@@ -638,10 +589,7 @@ definitions:
description: User Status
xml:
name: User
- Tag:
- title: Pet Tag
- description: A tag for a pet
- type: object
+ Category:
properties:
id:
type: integer
@@ -649,11 +597,8 @@ definitions:
name:
type: string
xml:
- name: Tag
+ name: Category
Pet:
- title: a Pet
- description: A pet for sale in the pet store
- type: object
required:
- name
- photoUrls
@@ -689,18 +634,37 @@ definitions:
- sold
xml:
name: Pet
- ApiResponse:
- title: An uploaded response
- description: Describes the result of uploading an image resource
- type: object
+ Tag:
properties:
- code:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ xml:
+ name: Tag
+ Order:
+ properties:
+ id:
+ type: integer
+ format: int64
+ petId:
+ type: integer
+ format: int64
+ quantity:
type: integer
format: int32
- type:
+ shipDate:
type: string
- message:
+ format: date-time
+ status:
type: string
-externalDocs:
- description: Find out more about Swagger
- url: 'http://swagger.io'
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ complete:
+ type: boolean
+ xml:
+ name: Order
diff --git a/pom.xml b/pom.xml
index 31be9ea8de..0f60d941dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -803,7 +803,6 @@
samples/client/petstore/jaxrs-cxf-client
samples/client/petstore/java/resttemplate
samples/client/petstore/scala
-
diff --git a/pom.xml.circleci b/pom.xml.circleci
index 31be9ea8de..f53bc69923 100644
--- a/pom.xml.circleci
+++ b/pom.xml.circleci
@@ -802,8 +802,8 @@
samples/client/petstore/java/retrofit2rx
samples/client/petstore/jaxrs-cxf-client
samples/client/petstore/java/resttemplate
- samples/client/petstore/scala
samples/server/petstore/spring-mvc
@@ -841,7 +841,6 @@
samples/server/petstore/jaxrs-cxf-annotated-base-path
samples/server/petstore/jaxrs-cxf-cdi
samples/server/petstore/jaxrs-cxf-non-spring-app
-
diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md
index 576d718f1f..81ef0a0bd8 100644
--- a/samples/client/petstore/android/httpclient/README.md
+++ b/samples/client/petstore/android/httpclient/README.md
@@ -106,6 +106,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
+ - [ApiResponse](docs/ApiResponse.md)
- [Category](docs/Category.md)
- [Order](docs/Order.md)
- [Pet](docs/Pet.md)
@@ -138,5 +139,5 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
## Author
-apiteam@wordnik.com
+apiteam@swagger.io
diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle
index 42adec67a4..298c66cccf 100644
--- a/samples/client/petstore/android/httpclient/build.gradle
+++ b/samples/client/petstore/android/httpclient/build.gradle
@@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.5.+'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
@@ -22,12 +22,12 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
- compileSdkVersion 23
- buildToolsVersion '23.0.2'
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 14
- targetSdkVersion 23
+ targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md
new file mode 100644
index 0000000000..1c17767c2b
--- /dev/null
+++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md
@@ -0,0 +1,12 @@
+
+# ApiResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md
index ff596b3d91..de0742023d 100644
--- a/samples/client/petstore/android/httpclient/docs/PetApi.md
+++ b/samples/client/petstore/android/httpclient/docs/PetApi.md
@@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -54,7 +54,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **deletePet**
@@ -98,7 +98,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **findPetsByStatus**
@@ -114,7 +114,7 @@ Multiple status values can be provided with comma separated strings
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+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);
@@ -128,7 +128,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [optional] [default to available] [enum: available, pending, sold]
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
@@ -141,7 +141,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **findPetsByTags**
@@ -171,7 +171,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **tags** | [**List<String>**](String.md)| Tags to filter by | [optional]
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
### Return type
@@ -184,7 +184,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getPetById**
@@ -192,7 +192,7 @@ Name | Type | Description | Notes
Find pet by ID
-Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+Returns a single pet
### Example
```java
@@ -200,7 +200,7 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API erro
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-Long petId = 789L; // Long | ID of pet that needs to be fetched
+Long petId = 789L; // Long | ID of pet to return
try {
Pet result = apiInstance.getPetById(petId);
System.out.println(result);
@@ -214,7 +214,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **petId** | **Long**| ID of pet that needs to be fetched |
+ **petId** | **Long**| ID of pet to return |
### Return type
@@ -222,12 +222,12 @@ Name | Type | Description | Notes
### Authorization
-[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
+[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updatePet**
@@ -256,7 +256,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -269,7 +269,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updatePetWithForm**
@@ -285,7 +285,7 @@ Updates a pet in the store with form data
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-String petId = "petId_example"; // String | ID of pet that needs to be updated
+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 {
@@ -300,7 +300,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **petId** | **String**| ID of pet that needs to be updated |
+ **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]
@@ -315,11 +315,11 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **uploadFile**
-> uploadFile(petId, additionalMetadata, file)
+> ApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
@@ -335,7 +335,8 @@ 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 {
- apiInstance.uploadFile(petId, additionalMetadata, file);
+ ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#uploadFile");
e.printStackTrace();
@@ -352,7 +353,7 @@ Name | Type | Description | Notes
### Return type
-null (empty response body)
+[**ApiResponse**](ApiResponse.md)
### Authorization
@@ -361,5 +362,5 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: multipart/form-data
- - **Accept**: application/json, application/xml
+ - **Accept**: application/json
diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md
index 5d35bca020..1741116be6 100644
--- a/samples/client/petstore/android/httpclient/docs/StoreApi.md
+++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md
@@ -50,7 +50,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getInventory**
@@ -89,7 +89,7 @@ This endpoint does not need any parameter.
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/json
# **getOrderById**
@@ -105,7 +105,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
//import io.swagger.client.api.StoreApi;
StoreApi apiInstance = new StoreApi();
-String orderId = "orderId_example"; // String | ID of pet that needs to be fetched
+Long orderId = 789L; // Long | ID of pet that needs to be fetched
try {
Order result = apiInstance.getOrderById(orderId);
System.out.println(result);
@@ -119,7 +119,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **orderId** | **String**| ID of pet that needs to be fetched |
+ **orderId** | **Long**| ID of pet that needs to be fetched |
### Return type
@@ -132,7 +132,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **placeOrder**
@@ -162,7 +162,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
@@ -175,5 +175,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md
index f87e8f5882..ca4908fd40 100644
--- a/samples/client/petstore/android/httpclient/docs/UserApi.md
+++ b/samples/client/petstore/android/httpclient/docs/UserApi.md
@@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](User.md)| Created user object | [optional]
+ **body** | [**User**](User.md)| Created user object |
### Return type
@@ -54,7 +54,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **createUsersWithArrayInput**
@@ -83,7 +83,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](User.md)| List of user object | [optional]
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -96,7 +96,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **createUsersWithListInput**
@@ -125,7 +125,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](User.md)| List of user object | [optional]
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -138,7 +138,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **deleteUser**
@@ -180,7 +180,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getUserByName**
@@ -223,7 +223,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **loginUser**
@@ -254,8 +254,8 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **String**| The user name for login | [optional]
- **password** | **String**| The password for login in clear text | [optional]
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
### Return type
@@ -268,7 +268,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **logoutUser**
@@ -306,7 +306,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updateUser**
@@ -337,7 +337,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
- **body** | [**User**](User.md)| Updated user object | [optional]
+ **body** | [**User**](User.md)| Updated user object |
### Return type
@@ -350,5 +350,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiException.java
index 60e7a3d92c..08d174c831 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiException.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiException.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiInvoker.java
index 3af4eda416..4d0076afb9 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiInvoker.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/ApiInvoker.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/HttpPatch.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/HttpPatch.java
index 833ba6c81c..460a373982 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/HttpPatch.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/HttpPatch.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/JsonUtil.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/JsonUtil.java
index e725cf3291..7234a4867d 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/JsonUtil.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/JsonUtil.java
@@ -35,6 +35,10 @@ public class JsonUtil {
public static Type getListTypeForDeserialization(Class cls) {
String className = cls.getSimpleName();
+ if ("ApiResponse".equalsIgnoreCase(className)) {
+ return new TypeToken>(){}.getType();
+ }
+
if ("Category".equalsIgnoreCase(className)) {
return new TypeToken>(){}.getType();
}
@@ -61,6 +65,10 @@ public class JsonUtil {
public static Type getTypeForDeserialization(Class cls) {
String className = cls.getSimpleName();
+ if ("ApiResponse".equalsIgnoreCase(className)) {
+ return new TypeToken(){}.getType();
+ }
+
if ("Category".equalsIgnoreCase(className)) {
return new TypeToken(){}.getType();
}
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/Pair.java
index d83f3053c7..b86b8466e5 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/Pair.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/Pair.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/PetApi.java
index 9b137a2628..56183aafc3 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/PetApi.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/PetApi.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -20,6 +20,7 @@ import io.swagger.client.model.*;
import java.util.*;
+import io.swagger.client.model.ApiResponse;
import java.io.File;
import io.swagger.client.model.Pet;
@@ -57,7 +58,10 @@ public class PetApi {
*/
public void addPet (Pet body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
+ }
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -107,12 +111,10 @@ public class PetApi {
*/
public void deletePet (Long petId, String apiKey) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
}
-
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -162,7 +164,10 @@ public class PetApi {
*/
public List findPetsByStatus (List status) throws ApiException {
Object localVarPostBody = null;
-
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
+ }
// create path and map variables
String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
@@ -174,7 +179,7 @@ public class PetApi {
// form params
Map localVarFormParams = new HashMap();
- localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
+ localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status));
String[] localVarContentTypes = {
@@ -212,7 +217,10 @@ public class PetApi {
*/
public List findPetsByTags (List tags) throws ApiException {
Object localVarPostBody = null;
-
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
+ }
// create path and map variables
String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
@@ -224,7 +232,7 @@ public class PetApi {
// form params
Map localVarFormParams = new HashMap();
- localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
+ localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags));
String[] localVarContentTypes = {
@@ -256,18 +264,16 @@ public class PetApi {
}
/**
* Find pet by ID
- * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- * @param petId ID of pet that needs to be fetched
+ * Returns a single pet
+ * @param petId ID of pet to return
* @return Pet
*/
public Pet getPetById (Long petId) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
}
-
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -316,7 +322,10 @@ public class PetApi {
*/
public void updatePet (Pet body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
+ }
// create path and map variables
String localVarPath = "/pet".replaceAll("\\{format\\}","json");
@@ -365,14 +374,12 @@ public class PetApi {
* @param status Updated status of the pet
* @return void
*/
- public void updatePetWithForm (String petId, String name, String status) throws ApiException {
+ public void updatePetWithForm (Long petId, String name, String status) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
}
-
// create path and map variables
String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -429,16 +436,14 @@ localVarFormParams.put("status", ApiInvoker.parameterToString(status));
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
- * @return void
+ * @return ApiResponse
*/
- public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
+ public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
}
-
// create path and map variables
String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -480,10 +485,10 @@ localVarFormParams.put("status", ApiInvoker.parameterToString(status));
try {
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
if(localVarResponse != null){
- return ;
+ return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class);
}
else {
- return ;
+ return null;
}
} catch (ApiException ex) {
throw ex;
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/StoreApi.java
index 307ed1ab33..4b1a3b690d 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/StoreApi.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/StoreApi.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -57,12 +57,10 @@ public class StoreApi {
*/
public void deleteOrder (String orderId) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
}
-
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
@@ -110,7 +108,6 @@ public class StoreApi {
*/
public Map getInventory () throws ApiException {
Object localVarPostBody = null;
-
// create path and map variables
String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
@@ -157,14 +154,12 @@ public class StoreApi {
* @param orderId ID of pet that needs to be fetched
* @return Order
*/
- public Order getOrderById (String orderId) throws ApiException {
+ public Order getOrderById (Long orderId) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
}
-
// create path and map variables
String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
@@ -213,7 +208,10 @@ public class StoreApi {
*/
public Order placeOrder (Order body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
+ }
// create path and map variables
String localVarPath = "/store/order".replaceAll("\\{format\\}","json");
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/UserApi.java
index 28def9124a..36dfb08980 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/UserApi.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/api/UserApi.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -57,7 +57,10 @@ public class UserApi {
*/
public void createUser (User body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
+ }
// create path and map variables
String localVarPath = "/user".replaceAll("\\{format\\}","json");
@@ -106,7 +109,10 @@ public class UserApi {
*/
public void createUsersWithArrayInput (List body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
+ }
// create path and map variables
String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json");
@@ -155,7 +161,10 @@ public class UserApi {
*/
public void createUsersWithListInput (List body) throws ApiException {
Object localVarPostBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
+ }
// create path and map variables
String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json");
@@ -204,12 +213,10 @@ public class UserApi {
*/
public void deleteUser (String username) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
}
-
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
@@ -258,12 +265,10 @@ public class UserApi {
*/
public User getUserByName (String username) throws ApiException {
Object localVarPostBody = null;
-
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
}
-
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
@@ -313,7 +318,14 @@ public class UserApi {
*/
public String loginUser (String username, String password) throws ApiException {
Object localVarPostBody = null;
-
+ // verify the required parameter 'username' is set
+ if (username == null) {
+ throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
+ }
+ // verify the required parameter 'password' is set
+ if (password == null) {
+ throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
+ }
// create path and map variables
String localVarPath = "/user/login".replaceAll("\\{format\\}","json");
@@ -363,7 +375,6 @@ public class UserApi {
*/
public void logoutUser () throws ApiException {
Object localVarPostBody = null;
-
// create path and map variables
String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");
@@ -413,12 +424,14 @@ public class UserApi {
*/
public void updateUser (String username, User body) throws ApiException {
Object localVarPostBody = body;
-
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
}
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
+ }
// create path and map variables
String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/ApiResponse.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/ApiResponse.java
new file mode 100644
index 0000000000..7204e72e36
--- /dev/null
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/ApiResponse.java
@@ -0,0 +1,86 @@
+package io.swagger.client.model;
+
+
+import io.swagger.annotations.*;
+import com.google.gson.annotations.SerializedName;
+
+
+/**
+ * Describes the result of uploading an image resource
+ **/
+@ApiModel(description = "Describes the result of uploading an image resource")
+public class ApiResponse {
+
+ @SerializedName("code")
+ private Integer code = null;
+ @SerializedName("type")
+ private String type = null;
+ @SerializedName("message")
+ private String message = null;
+
+ /**
+ **/
+ @ApiModelProperty(value = "")
+ public Integer getCode() {
+ return code;
+ }
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ /**
+ **/
+ @ApiModelProperty(value = "")
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ **/
+ @ApiModelProperty(value = "")
+ public String getMessage() {
+ return message;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ApiResponse apiResponse = (ApiResponse) o;
+ return (this.code == null ? apiResponse.code == null : this.code.equals(apiResponse.code)) &&
+ (this.type == null ? apiResponse.type == null : this.type.equals(apiResponse.type)) &&
+ (this.message == null ? apiResponse.message == null : this.message.equals(apiResponse.message));
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + (this.code == null ? 0: this.code.hashCode());
+ result = 31 * result + (this.type == null ? 0: this.type.hashCode());
+ result = 31 * result + (this.message == null ? 0: this.message.hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ApiResponse {\n");
+
+ sb.append(" code: ").append(code).append("\n");
+ sb.append(" type: ").append(type).append("\n");
+ sb.append(" message: ").append(message).append("\n");
+ sb.append("}\n");
+ return sb.toString();
+ }
+}
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Category.java
index eb9f643efe..22ddf3c314 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Category.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Category.java
@@ -5,7 +5,10 @@ import io.swagger.annotations.*;
import com.google.gson.annotations.SerializedName;
-@ApiModel(description = "")
+/**
+ * A category for a pet
+ **/
+@ApiModel(description = "A category for a pet")
public class Category {
@SerializedName("id")
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Order.java
index 5fe60f1bf5..45614fde18 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Order.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Order.java
@@ -6,7 +6,10 @@ import io.swagger.annotations.*;
import com.google.gson.annotations.SerializedName;
-@ApiModel(description = "")
+/**
+ * An order for a pets from the pet store
+ **/
+@ApiModel(description = "An order for a pets from the pet store")
public class Order {
@SerializedName("id")
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Pet.java
index 8795964a6b..6b9df4659e 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Pet.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Pet.java
@@ -8,7 +8,10 @@ import io.swagger.annotations.*;
import com.google.gson.annotations.SerializedName;
-@ApiModel(description = "")
+/**
+ * A pet for sale in the pet store
+ **/
+@ApiModel(description = "A pet for sale in the pet store")
public class Pet {
@SerializedName("id")
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Tag.java
index 3729c3674f..cb0b15af38 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Tag.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/Tag.java
@@ -5,7 +5,10 @@ import io.swagger.annotations.*;
import com.google.gson.annotations.SerializedName;
-@ApiModel(description = "")
+/**
+ * A tag for a pet
+ **/
+@ApiModel(description = "A tag for a pet")
public class Tag {
@SerializedName("id")
diff --git a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/User.java
index 4f789b5e35..92ea162a00 100644
--- a/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/User.java
+++ b/samples/client/petstore/android/httpclient/src/main/java/io/swagger/client/model/User.java
@@ -5,7 +5,10 @@ import io.swagger.annotations.*;
import com.google.gson.annotations.SerializedName;
-@ApiModel(description = "")
+/**
+ * A User who is purchasing from the pet store
+ **/
+@ApiModel(description = "A User who is purchasing from the pet store")
public class User {
@SerializedName("id")
diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md
index 0b51769d92..f8e840dec4 100644
--- a/samples/client/petstore/android/volley/README.md
+++ b/samples/client/petstore/android/volley/README.md
@@ -106,6 +106,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
+ - [ApiResponse](docs/ApiResponse.md)
- [Category](docs/Category.md)
- [Order](docs/Order.md)
- [Pet](docs/Pet.md)
@@ -138,5 +139,5 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
## Author
-apiteam@wordnik.com
+apiteam@swagger.io
diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle
index 64e2d8cc99..04ee2bd4f4 100644
--- a/samples/client/petstore/android/volley/build.gradle
+++ b/samples/client/petstore/android/volley/build.gradle
@@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.5.+'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
@@ -22,11 +22,11 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
- compileSdkVersion 23
- buildToolsVersion '23.0.2'
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 14
- targetSdkVersion 23
+ targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md
new file mode 100644
index 0000000000..1c17767c2b
--- /dev/null
+++ b/samples/client/petstore/android/volley/docs/ApiResponse.md
@@ -0,0 +1,12 @@
+
+# ApiResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md
index ff596b3d91..de0742023d 100644
--- a/samples/client/petstore/android/volley/docs/PetApi.md
+++ b/samples/client/petstore/android/volley/docs/PetApi.md
@@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -54,7 +54,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **deletePet**
@@ -98,7 +98,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **findPetsByStatus**
@@ -114,7 +114,7 @@ Multiple status values can be provided with comma separated strings
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+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);
@@ -128,7 +128,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [optional] [default to available] [enum: available, pending, sold]
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
@@ -141,7 +141,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **findPetsByTags**
@@ -171,7 +171,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **tags** | [**List<String>**](String.md)| Tags to filter by | [optional]
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
### Return type
@@ -184,7 +184,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getPetById**
@@ -192,7 +192,7 @@ Name | Type | Description | Notes
Find pet by ID
-Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+Returns a single pet
### Example
```java
@@ -200,7 +200,7 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API erro
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-Long petId = 789L; // Long | ID of pet that needs to be fetched
+Long petId = 789L; // Long | ID of pet to return
try {
Pet result = apiInstance.getPetById(petId);
System.out.println(result);
@@ -214,7 +214,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **petId** | **Long**| ID of pet that needs to be fetched |
+ **petId** | **Long**| ID of pet to return |
### Return type
@@ -222,12 +222,12 @@ Name | Type | Description | Notes
### Authorization
-[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
+[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updatePet**
@@ -256,7 +256,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -269,7 +269,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updatePetWithForm**
@@ -285,7 +285,7 @@ Updates a pet in the store with form data
//import io.swagger.client.api.PetApi;
PetApi apiInstance = new PetApi();
-String petId = "petId_example"; // String | ID of pet that needs to be updated
+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 {
@@ -300,7 +300,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **petId** | **String**| ID of pet that needs to be updated |
+ **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]
@@ -315,11 +315,11 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **uploadFile**
-> uploadFile(petId, additionalMetadata, file)
+> ApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
@@ -335,7 +335,8 @@ 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 {
- apiInstance.uploadFile(petId, additionalMetadata, file);
+ ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#uploadFile");
e.printStackTrace();
@@ -352,7 +353,7 @@ Name | Type | Description | Notes
### Return type
-null (empty response body)
+[**ApiResponse**](ApiResponse.md)
### Authorization
@@ -361,5 +362,5 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: multipart/form-data
- - **Accept**: application/json, application/xml
+ - **Accept**: application/json
diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md
index 5d35bca020..1741116be6 100644
--- a/samples/client/petstore/android/volley/docs/StoreApi.md
+++ b/samples/client/petstore/android/volley/docs/StoreApi.md
@@ -50,7 +50,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getInventory**
@@ -89,7 +89,7 @@ This endpoint does not need any parameter.
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/json
# **getOrderById**
@@ -105,7 +105,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
//import io.swagger.client.api.StoreApi;
StoreApi apiInstance = new StoreApi();
-String orderId = "orderId_example"; // String | ID of pet that needs to be fetched
+Long orderId = 789L; // Long | ID of pet that needs to be fetched
try {
Order result = apiInstance.getOrderById(orderId);
System.out.println(result);
@@ -119,7 +119,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **orderId** | **String**| ID of pet that needs to be fetched |
+ **orderId** | **Long**| ID of pet that needs to be fetched |
### Return type
@@ -132,7 +132,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **placeOrder**
@@ -162,7 +162,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
@@ -175,5 +175,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md
index f87e8f5882..ca4908fd40 100644
--- a/samples/client/petstore/android/volley/docs/UserApi.md
+++ b/samples/client/petstore/android/volley/docs/UserApi.md
@@ -41,7 +41,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](User.md)| Created user object | [optional]
+ **body** | [**User**](User.md)| Created user object |
### Return type
@@ -54,7 +54,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **createUsersWithArrayInput**
@@ -83,7 +83,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](User.md)| List of user object | [optional]
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -96,7 +96,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **createUsersWithListInput**
@@ -125,7 +125,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](User.md)| List of user object | [optional]
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -138,7 +138,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **deleteUser**
@@ -180,7 +180,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **getUserByName**
@@ -223,7 +223,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **loginUser**
@@ -254,8 +254,8 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **username** | **String**| The user name for login | [optional]
- **password** | **String**| The password for login in clear text | [optional]
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
### Return type
@@ -268,7 +268,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **logoutUser**
@@ -306,7 +306,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
# **updateUser**
@@ -337,7 +337,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
- **body** | [**User**](User.md)| Updated user object | [optional]
+ **body** | [**User**](User.md)| Updated user object |
### Return type
@@ -350,5 +350,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- - **Accept**: application/json, application/xml
+ - **Accept**: application/xml, application/json
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java
index 7ccb9a47f4..a7700357e2 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java
index 5791dbfd07..7a3d7e1ac2 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/JsonUtil.java
index d577a19271..8cd11f0d8b 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/JsonUtil.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/JsonUtil.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -57,6 +57,10 @@ public class JsonUtil {
public static Type getListTypeForDeserialization(Class cls) {
String className = cls.getSimpleName();
+ if ("ApiResponse".equalsIgnoreCase(className)) {
+ return new TypeToken>(){}.getType();
+ }
+
if ("Category".equalsIgnoreCase(className)) {
return new TypeToken>(){}.getType();
}
@@ -83,6 +87,10 @@ public class JsonUtil {
public static Type getTypeForDeserialization(Class cls) {
String className = cls.getSimpleName();
+ if ("ApiResponse".equalsIgnoreCase(className)) {
+ return new TypeToken(){}.getType();
+ }
+
if ("Category".equalsIgnoreCase(className)) {
return new TypeToken(){}.getType();
}
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/Pair.java
index df9d3f0390..d82e0db36d 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/Pair.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/Pair.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java
index 557c97a958..3253968072 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/PetApi.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -23,6 +23,7 @@ import java.util.*;
import com.android.volley.Response;
import com.android.volley.VolleyError;
+import io.swagger.client.model.ApiResponse;
import java.io.File;
import io.swagger.client.model.Pet;
@@ -64,6 +65,11 @@ public class PetApi {
*/
public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = body;
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet",
+ new ApiException(400, "Missing the required parameter 'body' when calling addPet"));
+ }
// create path and map variables
String path = "/pet";
@@ -103,15 +109,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -123,7 +129,11 @@ public class PetApi {
public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet",
+ new ApiException(400, "Missing the required parameter 'body' when calling addPet"));
+ }
// create path and map variables
String path = "/pet".replaceAll("\\{format\\}","json");
@@ -153,7 +163,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -224,15 +234,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -244,13 +254,11 @@ public class PetApi {
public void deletePet (Long petId, String apiKey, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
- VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet",
- new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"));
+ VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet",
+ new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"));
}
-
// create path and map variables
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -281,7 +289,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -308,6 +316,11 @@ public class PetApi {
*/
public List findPetsByStatus (List status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus",
+ new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"));
+ }
// create path and map variables
String path = "/pet/findByStatus";
@@ -318,7 +331,7 @@ public class PetApi {
Map headerParams = new HashMap();
// form params
Map formParams = new HashMap();
- queryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
+ queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status));
String[] contentTypes = {
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
@@ -346,15 +359,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -366,7 +379,11 @@ public class PetApi {
public void findPetsByStatus (List status, final Response.Listener> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'status' when calling findPetsByStatus",
+ new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"));
+ }
// create path and map variables
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
@@ -378,7 +395,7 @@ public class PetApi {
// form params
Map formParams = new HashMap();
- queryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
+ queryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status));
String[] contentTypes = {
@@ -397,7 +414,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -428,6 +445,11 @@ public class PetApi {
*/
public List findPetsByTags (List tags) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags",
+ new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"));
+ }
// create path and map variables
String path = "/pet/findByTags";
@@ -438,7 +460,7 @@ public class PetApi {
Map headerParams = new HashMap();
// form params
Map formParams = new HashMap();
- queryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
+ queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags));
String[] contentTypes = {
};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
@@ -466,15 +488,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -486,7 +508,11 @@ public class PetApi {
public void findPetsByTags (List tags, final Response.Listener> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'tags' when calling findPetsByTags",
+ new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"));
+ }
// create path and map variables
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
@@ -498,7 +524,7 @@ public class PetApi {
// form params
Map formParams = new HashMap();
- queryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
+ queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags));
String[] contentTypes = {
@@ -517,7 +543,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -542,8 +568,8 @@ public class PetApi {
}
/**
* Find pet by ID
- * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- * @param petId ID of pet that needs to be fetched
+ * Returns a single pet
+ * @param petId ID of pet to return
* @return Pet
*/
public Pet getPetById (Long petId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
@@ -576,7 +602,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth", "api_key" };
+ String[] authNames = new String[] { "api_key" };
try {
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
@@ -590,33 +616,31 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
/**
* Find pet by ID
- * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- * @param petId ID of pet that needs to be fetched
+ * Returns a single pet
+ * @param petId ID of pet to return
*/
public void getPetById (Long petId, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
- VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById",
- new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"));
+ VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetById",
+ new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"));
}
-
// create path and map variables
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -646,7 +670,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth", "api_key" };
+ String[] authNames = new String[] { "api_key" };
try {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -677,6 +701,11 @@ public class PetApi {
*/
public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = body;
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet",
+ new ApiException(400, "Missing the required parameter 'body' when calling updatePet"));
+ }
// create path and map variables
String path = "/pet";
@@ -716,15 +745,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -736,7 +765,11 @@ public class PetApi {
public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = body;
-
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet",
+ new ApiException(400, "Missing the required parameter 'body' when calling updatePet"));
+ }
// create path and map variables
String path = "/pet".replaceAll("\\{format\\}","json");
@@ -766,7 +799,7 @@ public class PetApi {
// normal form params
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -793,7 +826,7 @@ public class PetApi {
* @param status Updated status of the pet
* @return void
*/
- public void updatePetWithForm (String petId, String name, String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
+ public void updatePetWithForm (Long petId, String name, String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@@ -846,15 +879,15 @@ public class PetApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -863,16 +896,14 @@ public class PetApi {
*
* @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet
*/
- public void updatePetWithForm (String petId, String name, String status, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
+ public void updatePetWithForm (Long petId, String name, String status, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
- VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm",
- new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"));
+ VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling updatePetWithForm",
+ new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"));
}
-
// create path and map variables
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -912,7 +943,7 @@ public class PetApi {
formParams.put("status", ApiInvoker.parameterToString(status));
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -937,9 +968,9 @@ formParams.put("status", ApiInvoker.parameterToString(status));
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
- * @return void
+ * @return ApiResponse
*/
- public void uploadFile (Long petId, String additionalMetadata, File file) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
+ public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@@ -982,24 +1013,24 @@ formParams.put("status", ApiInvoker.parameterToString(status));
try {
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
if (localVarResponse != null) {
- return ;
+ return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class);
} else {
- return ;
+ return null;
}
} catch (ApiException ex) {
throw ex;
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -1008,16 +1039,14 @@ formParams.put("status", ApiInvoker.parameterToString(status));
*
* @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload
*/
- public void uploadFile (Long petId, String additionalMetadata, File file, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
+ public void uploadFile (Long petId, String additionalMetadata, File file, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
// verify the required parameter 'petId' is set
if (petId == null) {
- VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile",
- new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"));
+ VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling uploadFile",
+ new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"));
}
-
// create path and map variables
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
@@ -1057,14 +1086,18 @@ formParams.put("status", ApiInvoker.parameterToString(status));
}
- String[] authNames = new String[] { "petstore_auth" };
+ String[] authNames = new String[] { "petstore_auth" };
try {
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
new Response.Listener() {
@Override
public void onResponse(String localVarResponse) {
- responseListener.onResponse(localVarResponse);
+ try {
+ responseListener.onResponse((ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class));
+ } catch (ApiException exception) {
+ errorListener.onErrorResponse(new VolleyError(exception));
+ }
}
}, new Response.ErrorListener() {
@Override
diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java
index 16cd37138f..86b2b7e1c7 100644
--- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java
+++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java
@@ -1,9 +1,9 @@
/**
* Swagger Petstore
- * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
- * Contact: apiteam@wordnik.com
+ * Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -106,15 +106,15 @@ public class StoreApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -126,13 +126,11 @@ public class StoreApi {
public void deleteOrder (String orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
-
// verify the required parameter 'orderId' is set
if (orderId == null) {
- VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
- new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
+ VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling deleteOrder",
+ new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
}
-
// create path and map variables
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
@@ -162,7 +160,7 @@ public class StoreApi {
// normal form params
}
- String[] authNames = new String[] { };
+ String[] authNames = new String[] { };
try {
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
@@ -225,15 +223,15 @@ public class StoreApi {
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
- if (ex.getCause() instanceof VolleyError) {
- VolleyError volleyError = (VolleyError)ex.getCause();
- if (volleyError.networkResponse != null) {
- throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
- }
- }
- throw ex;
+ if (ex.getCause() instanceof VolleyError) {
+ VolleyError volleyError = (VolleyError)ex.getCause();
+ if (volleyError.networkResponse != null) {
+ throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
+ }
+ }
+ throw ex;
} catch (TimeoutException ex) {
- throw ex;
+ throw ex;
}
}
@@ -245,7 +243,6 @@ public class StoreApi {
public void getInventory (final Response.Listener