diff --git a/bin/windows/android-petstore-all.bat b/bin/windows/android-petstore-all.bat new file mode 100755 index 00000000000..65862f5f0b2 --- /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 00000000000..a31eb334ef8 --- /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 00000000000..94db84cc90a --- /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/java/io/swagger/codegen/languages/SpringCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java index 5c0c8c0834c..6bbed853e18 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java @@ -219,8 +219,8 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation if (!additionalProperties.containsKey(SINGLE_CONTENT_TYPES)) { additionalProperties.put(SINGLE_CONTENT_TYPES, "true"); this.setSingleContentTypes(true); - } + additionalProperties.put("useSpringCloudClient", true); } else { apiTemplateFiles.put("apiController.mustache", "Controller.java"); diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 0e23cd4f59b..610c97e4117 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -16,7 +16,9 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; +{{#useSpringCloudClient}} import java.io.IOException; +{{/useSpringCloudClient}} import java.util.List; {{#async}} @@ -52,11 +54,20 @@ public interface {{classname}} { produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}} consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}} method = RequestMethod.{{httpMethod}}) +{{#useSpringCloudClient}} + {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { + // do some magic! + return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; + }{{/jdk8}} + +{{/useSpringCloudClient}} +{{^useSpringCloudClient}} {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}} @RequestHeader("Accept") String accept){{#examples}}{{#-first}} throws IOException{{/-first}}{{/examples}}{{^jdk8}};{{/jdk8}}{{#jdk8}} { // do some magic! return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; }{{/jdk8}} +{{/useSpringCloudClient}} {{/operation}} } {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache index 76c283a7678..c2f437970ab 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache @@ -17,8 +17,10 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; +{{^useSpringCloudClient}} import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; +{{/useSpringCloudClient}} import java.util.List; {{#async}} @@ -52,6 +54,25 @@ public class {{classname}}Controller implements {{classname}} { public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}, {{/allParams}}@RequestHeader("Accept") String accept){{#examples}}{{#-first}} throws IOException{{/-first}}{{/examples}} { // do some magic! +{{#useSpringCloudClient}} + {{^isDelegate}} + {{^async}} + return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK); + {{/async}} + {{#async}} + return new CallablereturnTypes}}>>() { + @Override + public ResponseEntity<{{>returnTypes}}> call() throws Exception { + return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK); + } + }; + {{/async}} + {{/isDelegate}} + {{#isDelegate}} + return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/isDelegate}} +{{/useSpringCloudClient}} +{{^useSpringCloudClient}} {{^isDelegate}} {{^async}} {{#examples}} @@ -75,6 +96,7 @@ public class {{classname}}Controller implements {{classname}} { {{#isDelegate}} return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/isDelegate}} +{{/useSpringCloudClient}} } {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/android/api.mustache b/modules/swagger-codegen/src/main/resources/android/api.mustache index 5d8cdd330db..44e96c63fc0 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 7aa3bef6538..97c7c92ce63 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 be0254ec3a2..f498d308ba2 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 e3ba184ea57..692689565da 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 27c4ff1f241..ceade9ccc48 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 - @@ -833,15 +831,13 @@ samples/server/petstore/jaxrs-resteasy/joda samples/server/petstore/scalatra samples/server/petstore/spring-mvc - + samples/client/petstore/spring-cloud samples/server/petstore/springboot samples/server/petstore/springboot-beanvalidation samples/server/petstore/jaxrs-cxf 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/pom.xml.circleci b/pom.xml.circleci index 31be9ea8de4..f53bc69923c 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 576d718f1f1..81ef0a0bd8e 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 42adec67a41..298c66cccff 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 00000000000..1c17767c2b7 --- /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 ff596b3d918..de0742023d7 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 5d35bca0202..1741116be6f 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 f87e8f58827..ca4908fd40b 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 60e7a3d92c9..08d174c8318 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 3af4eda416d..4d0076afb90 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 833ba6c81c0..460a373982a 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 e725cf3291d..7234a4867df 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 d83f3053c71..b86b8466e54 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 9b137a26282..56183aafc3e 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 307ed1ab33d..4b1a3b690da 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 28def9124a8..36dfb08980c 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 00000000000..7204e72e363 --- /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 eb9f643efe0..22ddf3c3148 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 5fe60f1bf56..45614fde185 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 8795964a6b3..6b9df4659eb 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 3729c3674fb..cb0b15af38d 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 4f789b5e359..92ea162a005 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 0b51769d921..f8e840dec40 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 64e2d8cc991..04ee2bd4f4f 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 00000000000..1c17767c2b7 --- /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 ff596b3d918..de0742023d7 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 5d35bca0202..1741116be6f 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 f87e8f58827..ca4908fd40b 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 7ccb9a47f48..a7700357e23 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 5791dbfd072..7a3d7e1ac24 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 d577a192713..8cd11f0d8b3 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 df9d3f03908..d82e0db36d6 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 557c97a958f..3253968072a 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 16cd37138fe..86b2b7e1c79 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> responseListener, final Response.ErrorListener errorListener) { Object postBody = null; - // create path and map variables String path = "/store/inventory".replaceAll("\\{format\\}","json"); @@ -275,7 +272,7 @@ public class StoreApi { // normal form params } - String[] authNames = new String[] { "api_key" }; + String[] authNames = new String[] { "api_key" }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -304,7 +301,7 @@ public class StoreApi { * @param orderId ID of pet that needs to be fetched * @return Order */ - public Order getOrderById (String orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + public Order getOrderById (Long orderId) throws TimeoutException, ExecutionException, InterruptedException, ApiException { Object postBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -348,15 +345,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; } } @@ -365,16 +362,14 @@ public class StoreApi { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public void getOrderById (String orderId, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + public void getOrderById (Long 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 getOrderById", - new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); + VolleyError error = new VolleyError("Missing the required parameter 'orderId' when calling getOrderById", + new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById")); } - // create path and map variables String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); @@ -404,7 +399,7 @@ public class StoreApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -435,6 +430,11 @@ public class StoreApi { */ public Order placeOrder (Order 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 placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + } // create path and map variables String path = "/store/order"; @@ -472,15 +472,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; } } @@ -492,7 +492,11 @@ public class StoreApi { public void placeOrder (Order 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 placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + } // create path and map variables String path = "/store/order".replaceAll("\\{format\\}","json"); @@ -522,7 +526,7 @@ public class StoreApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java index 83bdcbd8305..ab7fc5b1405 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/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 @@ -64,6 +64,11 @@ public class UserApi { */ public void createUser (User 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 createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + } // create path and map variables String path = "/user"; @@ -101,15 +106,15 @@ public class UserApi { } 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; } } @@ -121,7 +126,11 @@ public class UserApi { public void createUser (User 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 createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + } // create path and map variables String path = "/user".replaceAll("\\{format\\}","json"); @@ -151,7 +160,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -178,6 +187,11 @@ public class UserApi { */ public void createUsersWithArrayInput (List 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 createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + } // create path and map variables String path = "/user/createWithArray"; @@ -215,15 +229,15 @@ public class UserApi { } 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; } } @@ -235,7 +249,11 @@ public class UserApi { public void createUsersWithArrayInput (List 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 createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + } // create path and map variables String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); @@ -265,7 +283,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -292,6 +310,11 @@ public class UserApi { */ public void createUsersWithListInput (List 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 createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + } // create path and map variables String path = "/user/createWithList"; @@ -329,15 +352,15 @@ public class UserApi { } 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; } } @@ -349,7 +372,11 @@ public class UserApi { public void createUsersWithListInput (List 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 createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + } // create path and map variables String path = "/user/createWithList".replaceAll("\\{format\\}","json"); @@ -379,7 +406,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -448,15 +475,15 @@ public class UserApi { } 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; } } @@ -468,13 +495,11 @@ public class UserApi { public void deleteUser (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { Object postBody = null; - // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", - new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling deleteUser", + new ApiException(400, "Missing the required parameter 'username' when calling deleteUser")); } - // create path and map variables String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); @@ -504,7 +529,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -573,15 +598,15 @@ public class UserApi { } 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; } } @@ -593,13 +618,11 @@ public class UserApi { public void getUserByName (String username, final Response.Listener responseListener, final Response.ErrorListener errorListener) { Object postBody = null; - // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", - new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling getUserByName", + new ApiException(400, "Missing the required parameter 'username' when calling getUserByName")); } - // create path and map variables String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); @@ -629,7 +652,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -661,6 +684,16 @@ public class UserApi { */ public String loginUser (String username, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", + new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", + new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); + } // create path and map variables String path = "/user/login"; @@ -700,15 +733,15 @@ public class UserApi { } 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; } } @@ -720,7 +753,16 @@ public class UserApi { public void loginUser (String username, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { Object postBody = null; - + // verify the required parameter 'username' is set + if (username == null) { + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling loginUser", + new ApiException(400, "Missing the required parameter 'username' when calling loginUser")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling loginUser", + new ApiException(400, "Missing the required parameter 'password' when calling loginUser")); + } // create path and map variables String path = "/user/login".replaceAll("\\{format\\}","json"); @@ -752,7 +794,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -819,15 +861,15 @@ public class UserApi { } 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; } } @@ -839,7 +881,6 @@ public class UserApi { public void logoutUser (final Response.Listener responseListener, final Response.ErrorListener errorListener) { Object postBody = null; - // create path and map variables String path = "/user/logout".replaceAll("\\{format\\}","json"); @@ -869,7 +910,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -902,6 +943,11 @@ public class UserApi { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + } // create path and map variables String path = "/user/{username}".replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); @@ -939,15 +985,15 @@ public class UserApi { } 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; } } @@ -959,13 +1005,16 @@ public class UserApi { public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { Object postBody = body; - // verify the required parameter 'username' is set if (username == null) { - VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", - new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); + VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", + new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); + } + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } - // create path and map variables String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); @@ -995,7 +1044,7 @@ public class UserApi { // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { }; try { apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames, diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/ApiKeyAuth.java index 58a3022c041..5df37cb9121 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/ApiKeyAuth.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/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/Authentication.java index 8f5eb5386d2..02045a375dc 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/Authentication.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/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 21019099056..dbefda822f3 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/auth/HttpBasicAuth.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/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/ApiResponse.java new file mode 100644 index 00000000000..27b63fa1470 --- /dev/null +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/ApiResponse.java @@ -0,0 +1,96 @@ +/** + * Swagger Petstore + * 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@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +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/volley/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java index fd248cdb477..6a5c1b3f71d 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.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 @@ -15,7 +15,10 @@ package io.swagger.client.model; 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/volley/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java index 348cb9f5e9b..63ff6f364b7 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.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 @@ -16,7 +16,10 @@ import java.util.Date; 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/volley/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java index 5a8571e44af..7191b3d6dc0 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.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 @@ -18,7 +18,10 @@ import java.util.*; 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/volley/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java index f0092bfc96e..c4eb49aa8a2 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.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 @@ -15,7 +15,10 @@ package io.swagger.client.model; 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/volley/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java index 1ea255e7eea..11617e989f7 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.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 @@ -15,7 +15,10 @@ package io.swagger.client.model; 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/src/main/java/io/swagger/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java index e957462d963..a75ca45a98f 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.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/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java index a1cb0015126..de64e920320 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.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/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java index 844d49c81f9..09fac5e1148 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.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/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java index 85e537bb0aa..459ab851b0a 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.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/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java index bd7f9dad742..c489cce2cdc 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.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/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 4a9c5cca68d..679c5f52294 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -1,6 +1,5 @@ package io.swagger.api; -import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import org.springframework.core.io.Resource; @@ -35,7 +34,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) @Valid @RequestBody Pet body); @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @@ -50,7 +49,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -66,7 +65,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List status, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", allowableValues = "available, pending, sold", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status); @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -82,10 +81,14 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand>> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags); - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }), @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -96,7 +99,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId); @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @@ -113,7 +116,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) @Valid @RequestBody Pet body); @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @@ -128,21 +131,21 @@ public interface PetApi { produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestParam("file") MultipartFile file, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java index 8cb84909188..b4364dce026 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java @@ -30,7 +30,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -42,7 +42,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand>> getInventory( @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand>> getInventory(); @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @@ -54,7 +54,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @@ -65,6 +65,6 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) @Valid @RequestBody Order body); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index 68ed26e5263..b13dffed5ba 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ) @Valid @RequestBody User body); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @@ -39,7 +39,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ) @Valid @RequestBody List body); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @@ -49,7 +49,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ) @Valid @RequestBody List body); @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @@ -60,7 +60,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username); @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @@ -72,7 +72,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username); @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @@ -83,7 +83,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password, @RequestHeader("Accept") String accept) throws IOException; + com.netflix.hystrix.HystrixCommand> loginUser(@ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username,@ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @@ -93,7 +93,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> logoutUser( @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> logoutUser(); @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @@ -104,6 +104,6 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept); + com.netflix.hystrix.HystrixCommand> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ) @Valid @RequestBody User body); } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java index 7289c191a9c..6dd9cb7a2ad 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java @@ -9,9 +9,8 @@ import javax.validation.Valid; import javax.validation.constraints.*; /** - * A category for a pet + * Category */ -@ApiModel(description = "A category for a pet") public class Category { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java deleted file mode 100644 index d9a1123d082..00000000000 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java +++ /dev/null @@ -1,129 +0,0 @@ -package io.swagger.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * Describes the result of uploading an image resource - */ -@ApiModel(description = "Describes the result of uploading an image resource") - -public class ModelApiResponse { - @JsonProperty("code") - private Integer code = null; - - @JsonProperty("type") - private String type = null; - - @JsonProperty("message") - private String message = null; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @ApiModelProperty(value = "") - - @Valid - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @ApiModelProperty(value = "") - - @Valid - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @ApiModelProperty(value = "") - - @Valid - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java index e417cc17e61..1f22c71f67d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java @@ -11,9 +11,8 @@ import javax.validation.Valid; import javax.validation.constraints.*; /** - * An order for a pets from the pet store + * Order */ -@ApiModel(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") @@ -65,7 +64,7 @@ public class Order { private StatusEnum status = null; @JsonProperty("complete") - private Boolean complete = false; + private Boolean complete = null; public Order id(Long id) { this.id = id; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java index f79e9ae56d4..c84687b699f 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java @@ -14,9 +14,8 @@ import javax.validation.Valid; import javax.validation.constraints.*; /** - * A pet for sale in the pet store + * Pet */ -@ApiModel(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java index e9ad7e51654..9f8f3a25234 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java @@ -9,9 +9,8 @@ import javax.validation.Valid; import javax.validation.constraints.*; /** - * A tag for a pet + * Tag */ -@ApiModel(description = "A tag for a pet") public class Tag { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java index b3b24907d97..501c556de27 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java @@ -9,9 +9,8 @@ import javax.validation.Valid; import javax.validation.constraints.*; /** - * A User who is purchasing from the pet store + * User */ -@ApiModel(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index f6093ba101c..c008eba7f55 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java index bd3568f20e1..ee2826b8553 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index 1227aedbbd7..8fc4d1e7cb7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index fb8f3d706f5..cc6459f6442 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.util.List; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index adc0d21d30b..390c3ff657c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.util.List; import javax.validation.constraints.*;