From bee999056a9a13a37891a9c7810f30ef63eb4f38 Mon Sep 17 00:00:00 2001 From: imgx64 Date: Wed, 31 May 2017 01:13:22 -0800 Subject: [PATCH 1/5] [typescript-angular2] Avoid tslint "Unused import" warnings (#5723) Move the tslint comment that disables `no-unused-variable` to before the import statements, to avoid "Unused import" warnings --- .../src/main/resources/typescript-angular2/api.mustache | 4 ++-- .../client/petstore/typescript-angular2/default/api/PetApi.ts | 4 ++-- .../petstore/typescript-angular2/default/api/StoreApi.ts | 4 ++-- .../petstore/typescript-angular2/default/api/UserApi.ts | 4 ++-- samples/client/petstore/typescript-angular2/npm/api/PetApi.ts | 4 ++-- .../client/petstore/typescript-angular2/npm/api/StoreApi.ts | 4 ++-- .../client/petstore/typescript-angular2/npm/api/UserApi.ts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index 76682a0b9e9..2f3b55bbccf 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -1,4 +1,6 @@ {{>licenseInfo}} +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -14,8 +16,6 @@ import { Configuration } from '../configurat import { {{classname}}Interface } from './{{classname}}Interface'; {{/withInterfaces}} -/* tslint:disable:no-unused-variable member-ordering */ - {{#operations}} {{#description}} diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index 7723c7c13c1..0587fede365 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetApi { diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index efaf851e010..a0847d7049a 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreApi { diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index d5293c49f99..f5680156442 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserApi { diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index 7723c7c13c1..0587fede365 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetApi { diff --git a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts index efaf851e010..a0847d7049a 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreApi { diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index d5293c49f99..f5680156442 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -10,6 +10,8 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; @@ -22,8 +24,6 @@ import * as models from '../model/mode import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserApi { From d6f242415279849e6c22c46983c453faa96318e1 Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Wed, 31 May 2017 05:27:32 -0400 Subject: [PATCH 2/5] Fix spring generated controller annotations only generating for first return type (#5399) Fixes the spring java code generator so that the ApiResponse fields are populated correctly on the controller. Related to #4693 --- .../codegen/languages/SpringCodegen.java | 82 +++++++++++++------ .../main/resources/JavaSpring/api.mustache | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- .../src/main/java/io/swagger/api/PetApi.java | 12 +-- .../main/java/io/swagger/api/StoreApi.java | 8 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +- 26 files changed, 163 insertions(+), 129 deletions(-) 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 6f847dec2f7..35d2f25fbf9 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 @@ -384,40 +384,39 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation Map operations = (Map) objs.get("operations"); if (operations != null) { List ops = (List) operations.get("operation"); - for (CodegenOperation operation : ops) { + for (final CodegenOperation operation : ops) { List responses = operation.responses; if (responses != null) { - for (CodegenResponse resp : responses) { + for (final CodegenResponse resp : responses) { if ("0".equals(resp.code)) { resp.code = "200"; } + doDataTypeAssignment(resp.dataType, new DataTypeAssigner() { + @Override + public void setReturnType(final String returnType) { + resp.dataType = returnType; + } + + @Override + public void setReturnContainer(final String returnContainer) { + resp.containerType = returnContainer; + } + }); } } - if (operation.returnType == null) { - operation.returnType = "Void"; - } else if (operation.returnType.startsWith("List")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("List<".length(), end).trim(); - operation.returnContainer = "List"; + doDataTypeAssignment(operation.returnType, new DataTypeAssigner() { + + @Override + public void setReturnType(final String returnType) { + operation.returnType = returnType; } - } else if (operation.returnType.startsWith("Map")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Map<".length(), end).split(",")[1].trim(); - operation.returnContainer = "Map"; + + @Override + public void setReturnContainer(final String returnContainer) { + operation.returnContainer = returnContainer; } - } else if (operation.returnType.startsWith("Set")) { - String rt = operation.returnType; - int end = rt.lastIndexOf(">"); - if (end > 0) { - operation.returnType = rt.substring("Set<".length(), end).trim(); - operation.returnContainer = "Set"; - } - } + }); if(implicitHeaders){ removeHeadersFromAllParams(operation.allParams); @@ -428,6 +427,41 @@ public class SpringCodegen extends AbstractJavaCodegen implements BeanValidation return objs; } + private interface DataTypeAssigner { + void setReturnType(String returnType); + void setReturnContainer(String returnContainer); + } + + /** + * + * @param returnType The return type that needs to be converted + * @param dataTypeAssigner An object that will assign the data to the respective fields in the model. + */ + private void doDataTypeAssignment(String returnType, DataTypeAssigner dataTypeAssigner) { + final String rt = returnType; + if (rt == null) { + dataTypeAssigner.setReturnType("Void"); + } else if (rt.startsWith("List")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + dataTypeAssigner.setReturnType(rt.substring("List<".length(), end).trim()); + dataTypeAssigner.setReturnContainer("List"); + } + } else if (rt.startsWith("Map")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + dataTypeAssigner.setReturnType(rt.substring("Map<".length(), end).split(",")[1].trim()); + dataTypeAssigner.setReturnContainer("Map"); + } + } else if (rt.startsWith("Set")) { + int end = rt.lastIndexOf(">"); + if (end > 0) { + dataTypeAssigner.setReturnType(rt.substring("Set<".length(), end).trim()); + dataTypeAssigner.setReturnContainer("Set"); + } + } + } + /** * This method removes header parameters from the list of parameters and also * corrects last allParams hasMore state. diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 1371e29c5d9..02e4f7e0d11 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -39,7 +39,7 @@ public interface {{classname}} { {{/hasMore}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{dataType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) {{#implicitHeaders}}@ApiImplicitParams({ {{#headerParams}}{{>implicitHeader}}{{/headerParams}} }){{/implicitHeaders}} 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 c155dfa0537..c9ea9a423b5 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 @@ -61,8 +61,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = "application/json", @@ -78,8 +78,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = "application/json", @@ -93,8 +93,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = "application/json", 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 fc5d6b4889e..6e8e5e40a15 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 @@ -37,7 +37,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = "application/json", @@ -49,8 +49,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", @@ -62,7 +62,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = "application/json", 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 5014c4cc7cf..f888d5f40fd 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 @@ -69,8 +69,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = "application/json", @@ -82,7 +82,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = "application/json", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index db67d11eeb6..5a10bfd9516 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -61,8 +61,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = "application/json", @@ -78,8 +78,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = "application/json", @@ -93,8 +93,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = "application/json", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index 2e3319c5b1f..22d5d463d75 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -37,7 +37,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = "application/json", @@ -49,8 +49,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", @@ -62,7 +62,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = "application/json", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index ceab49231a5..b934b56d9ea 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -69,8 +69,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = "application/json", @@ -82,7 +82,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = "application/json", diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index 541cf279034..58372b53710 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -68,8 +68,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -87,8 +87,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -104,8 +104,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index 8a1056032ba..14f9aaabd73 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -41,7 +41,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -55,8 +55,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -70,7 +70,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 97cf9be47e9..63dc988db0b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -79,8 +79,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -94,7 +94,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, 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 9e5bad2b5a2..f845e16f537 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 @@ -60,8 +60,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -76,8 +76,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -90,8 +90,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, 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 8b080a440dd..56895a0eaaf 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 @@ -36,7 +36,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -47,8 +47,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -59,7 +59,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, 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 55fe9faf684..ebf3f58c1df 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 @@ -65,8 +65,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -77,7 +77,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java index 9e5bad2b5a2..f845e16f537 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java @@ -60,8 +60,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -76,8 +76,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -90,8 +90,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java index 8b080a440dd..56895a0eaaf 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java @@ -36,7 +36,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -47,8 +47,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -59,7 +59,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java index 55fe9faf684..ebf3f58c1df 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java @@ -65,8 +65,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -77,7 +77,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index d9b7399573d..01ff5dd9497 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -67,8 +67,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -86,8 +86,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -103,8 +103,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index c3745d9ec54..527cb98d95f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -40,7 +40,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -54,8 +54,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -69,7 +69,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index 0b8c3e31073..807d3eb9f9d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -78,8 +78,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -93,7 +93,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index 9e5bad2b5a2..f845e16f537 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -60,8 +60,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -76,8 +76,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -90,8 +90,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index 8b080a440dd..56895a0eaaf 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -36,7 +36,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -47,8 +47,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -59,7 +59,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index 55fe9faf684..ebf3f58c1df 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -65,8 +65,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -77,7 +77,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index 9e5bad2b5a2..f845e16f537 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -60,8 +60,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, @@ -76,8 +76,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, @@ -90,8 +90,8 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), - @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index 8b080a440dd..56895a0eaaf 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -36,7 +36,7 @@ public interface StoreApi { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = { "application/json" }, @@ -47,8 +47,8 @@ public interface StoreApi { @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", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), - @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, @@ -59,7 +59,7 @@ public interface StoreApi { @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 55fe9faf684..ebf3f58c1df 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -65,8 +65,8 @@ public interface UserApi { @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), - @ApiResponse(code = 404, message = "User not found", response = User.class) }) + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, @@ -77,7 +77,7 @@ public interface UserApi { @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, From bda5f1a5d541f4dcedd3509b10b7253c8b34f3fd Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 31 May 2017 17:39:58 +0800 Subject: [PATCH 3/5] add npm config set to avoid time out --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 156a5dbfcdb..e47f69a3953 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ before_install: # required when sudo: required for the Ruby petstore tests - gem install bundler - npm install -g typescript + - npm config set registry http://registry.npmjs.org/ - sudo pip install virtualenv # to run petstore server locally via docker - docker pull swaggerapi/petstore From 9070c7133ceacaf96898d32105625a380cea04e2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 31 May 2017 23:14:37 +0800 Subject: [PATCH 4/5] minor code format enhancement to ZipUtil.java --- .../io/swagger/generator/util/ZipUtil.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/swagger-generator/src/main/java/io/swagger/generator/util/ZipUtil.java b/modules/swagger-generator/src/main/java/io/swagger/generator/util/ZipUtil.java index 3295be5d898..88b4cbf6c8a 100644 --- a/modules/swagger-generator/src/main/java/io/swagger/generator/util/ZipUtil.java +++ b/modules/swagger-generator/src/main/java/io/swagger/generator/util/ZipUtil.java @@ -34,18 +34,19 @@ import java.util.zip.ZipOutputStream; */ public class ZipUtil { /** - * A constants for buffer size used to read/write data + * A constants for buffer size used to read/write data. */ private static final int BUFFER_SIZE = 4096; /** - * Compresses a collection of files to a destination zip file + * Compresses a collection of files to a destination zip file. * @param listFiles A collection of files and directories * @param destZipFile The path of the destination zip file - * @throws FileNotFoundException - * @throws IOException + * @throws FileNotFoundException if file not found + * @throws IOException if IO exception occurs */ - public void compressFiles(List listFiles, String destZipFile) throws FileNotFoundException, IOException { + public void compressFiles(List listFiles, String destZipFile) + throws FileNotFoundException, IOException { ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(destZipFile)); @@ -62,12 +63,12 @@ public class ZipUtil { } /** - * Adds a directory to the current zip output stream + * Adds a directory to the current zip output stream. * @param folder the directory to be added * @param parentFolder the path of parent directory * @param zos the current zip output stream - * @throws FileNotFoundException - * @throws IOException + * @throws FileNotFoundException if file not found + * @throws IOException if IO exception occurs */ private void addFolderToZip(File folder, String parentFolder, ZipOutputStream zos) throws FileNotFoundException, IOException { @@ -97,11 +98,11 @@ public class ZipUtil { } /** - * Adds a file to the current zip output stream + * Adds a file to the current zip output stream. * @param file the file to be added * @param zos the current zip output stream - * @throws FileNotFoundException - * @throws IOException + * @throws FileNotFoundException if file not found + * @throws IOException if IO exception occurs */ private static void addFileToZip(File file, ZipOutputStream zos) throws FileNotFoundException, IOException { @@ -119,4 +120,4 @@ public class ZipUtil { zos.closeEntry(); } -} \ No newline at end of file +} From bd9142150e565682f936b71f35de9c278537175b Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 31 May 2017 10:44:24 -0700 Subject: [PATCH 5/5] updated to 1.0.29 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a8c16156fc..ff3db301cb8 100644 --- a/pom.xml +++ b/pom.xml @@ -911,7 +911,7 @@ - 1.0.28 + 1.0.29 2.11.1 3.3.0 1.5.12