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 6bbed853e18..b9892ec313c 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 @@ -406,40 +406,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); @@ -450,6 +449,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 8f7677c386d..786fcfd3b64 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -42,7 +42,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}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache index 75aba1c5382..2e12a1bed2f 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.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'; @@ -17,8 +19,6 @@ import { Configuration } from '../configurat import { {{classname}}Interface } from './{{classname}}Interface'; {{/withInterfaces}} -/* tslint:disable:no-unused-variable member-ordering */ - {{#operations}} {{#description}} 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 +} 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 ad9c5c2929b..4ce976078df 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 @@ -59,8 +59,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", consumes = "application/json", @@ -75,8 +75,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", consumes = "application/json", @@ -89,8 +89,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", consumes = "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 c8a7cace4d5..744ee6bf365 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 @@ -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", consumes = "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/{orderId}", produces = "application/json", consumes = "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/json", consumes = "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 b01bae3dc37..58b463d8023 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 @@ -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/json", consumes = "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/json", consumes = "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 eb771932d19..9a15f821f44 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 @@ -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/json", consumes = "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/json", consumes = "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/json", consumes = "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 e4587f6f29d..189c1545a07 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", consumes = "application/json", @@ -48,8 +48,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", consumes = "application/json", @@ -60,7 +60,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", consumes = "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 b8fd1fb02b3..b55c5dfd436 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 @@ -66,8 +66,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", consumes = "application/json", @@ -78,7 +78,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", consumes = "application/json", diff --git a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts index 9cddf65f902..93ecbfd4818 100644 --- a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/pet.service.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'; @@ -24,8 +26,6 @@ import { Pet } from '../model/pet'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular2/default/api/store.service.ts b/samples/client/petstore/typescript-angular2/default/api/store.service.ts index 5793023a600..2fd90e5e5ea 100644 --- a/samples/client/petstore/typescript-angular2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/store.service.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'; @@ -23,8 +25,6 @@ import { Order } from '../model/order'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular2/default/api/user.service.ts b/samples/client/petstore/typescript-angular2/default/api/user.service.ts index e5eb63c1466..b2e1b7b09d3 100644 --- a/samples/client/petstore/typescript-angular2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/user.service.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'; @@ -23,8 +25,6 @@ import { User } from '../model/user'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserService { diff --git a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts index 9cddf65f902..93ecbfd4818 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/pet.service.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'; @@ -24,8 +26,6 @@ import { Pet } from '../model/pet'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class PetService { diff --git a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular2/npm/api/store.service.ts index 5793023a600..2fd90e5e5ea 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/store.service.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'; @@ -23,8 +25,6 @@ import { Order } from '../model/order'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class StoreService { diff --git a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular2/npm/api/user.service.ts index e5eb63c1466..b2e1b7b09d3 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/user.service.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'; @@ -23,8 +25,6 @@ import { User } from '../model/user'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -/* tslint:disable:no-unused-variable member-ordering */ - @Injectable() export class UserService { 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 57191ad1557..6e8d4b50448 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 @@ -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" }, method = RequestMethod.GET) @@ -85,8 +85,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" }, method = RequestMethod.GET) @@ -101,8 +101,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" }, method = RequestMethod.GET) 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 17a66d0e576..f14e4bcaf79 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" }, method = RequestMethod.GET) @@ -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" }, method = RequestMethod.GET) @@ -68,7 +68,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" }, method = RequestMethod.POST) 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 c23218d1537..cd9972ee144 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 @@ -76,8 +76,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" }, method = RequestMethod.GET) @@ -90,7 +90,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" }, method = RequestMethod.GET) 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 9abff09c190..c203ebf36c5 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 @@ -59,8 +59,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" }, method = RequestMethod.GET) @@ -74,8 +74,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" }, method = RequestMethod.GET) @@ -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 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" }, method = RequestMethod.GET) 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 0d8d9c8e004..0e51152b23e 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" }, method = RequestMethod.GET) @@ -46,8 +46,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" }, method = RequestMethod.GET) @@ -57,7 +57,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" }, method = RequestMethod.POST) 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 a4583a0841c..0d4c14517d0 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 @@ -62,8 +62,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" }, method = RequestMethod.GET) @@ -73,7 +73,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" }, method = RequestMethod.GET) 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 9abff09c190..c203ebf36c5 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 @@ -59,8 +59,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" }, method = RequestMethod.GET) @@ -74,8 +74,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" }, method = RequestMethod.GET) @@ -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 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" }, method = RequestMethod.GET) 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 0d8d9c8e004..0e51152b23e 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" }, method = RequestMethod.GET) @@ -46,8 +46,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" }, method = RequestMethod.GET) @@ -57,7 +57,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" }, method = RequestMethod.POST) 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 a4583a0841c..0d4c14517d0 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 @@ -62,8 +62,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" }, method = RequestMethod.GET) @@ -73,7 +73,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" }, method = RequestMethod.GET) 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 c26b87228f7..ec4fcb41c2c 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 @@ -66,8 +66,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" }, method = RequestMethod.GET) @@ -84,8 +84,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" }, method = RequestMethod.GET) @@ -100,8 +100,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" }, method = RequestMethod.GET) 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 342e0268cfc..609cebad91b 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" }, method = RequestMethod.GET) @@ -53,8 +53,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" }, method = RequestMethod.GET) @@ -67,7 +67,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" }, method = RequestMethod.POST) 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 f023e7a2584..e02af7a92d4 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 @@ -75,8 +75,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" }, method = RequestMethod.GET) @@ -89,7 +89,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" }, method = RequestMethod.GET) 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 9abff09c190..c203ebf36c5 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 @@ -59,8 +59,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" }, method = RequestMethod.GET) @@ -74,8 +74,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" }, method = RequestMethod.GET) @@ -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 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" }, method = RequestMethod.GET) 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 0d8d9c8e004..0e51152b23e 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" }, method = RequestMethod.GET) @@ -46,8 +46,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" }, method = RequestMethod.GET) @@ -57,7 +57,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" }, method = RequestMethod.POST) 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 a4583a0841c..0d4c14517d0 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 @@ -62,8 +62,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" }, method = RequestMethod.GET) @@ -73,7 +73,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" }, method = RequestMethod.GET) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java index 6d44540fd81..83325245e38 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -65,8 +65,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) }) @ApiImplicitParams({ }) @@ -83,8 +83,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) }) @ApiImplicitParams({ }) @@ -99,8 +99,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) }) @ApiImplicitParams({ }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java index 1eb6073ceff..9ffa5e6b149 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -39,7 +39,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") }) @ApiImplicitParams({ }) @@ -52,8 +52,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) }) @ApiImplicitParams({ }) @@ -66,7 +66,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) }) @ApiImplicitParams({ }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java index 51c4d2bb6be..406ee307e1f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -74,8 +74,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) }) @ApiImplicitParams({ }) @@ -88,7 +88,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) }) @ApiImplicitParams({ }) 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 9abff09c190..c203ebf36c5 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 @@ -59,8 +59,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" }, method = RequestMethod.GET) @@ -74,8 +74,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" }, method = RequestMethod.GET) @@ -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 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" }, method = RequestMethod.GET) 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 0d8d9c8e004..0e51152b23e 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" }, method = RequestMethod.GET) @@ -46,8 +46,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" }, method = RequestMethod.GET) @@ -57,7 +57,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" }, method = RequestMethod.POST) 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 a4583a0841c..0d4c14517d0 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 @@ -62,8 +62,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" }, method = RequestMethod.GET) @@ -73,7 +73,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" }, method = RequestMethod.GET)