diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache index 6d786768986..f0ad70a40ec 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -11,4 +11,4 @@ }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) - {{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}); \ No newline at end of file + {{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) throws Exception; \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache index b317e750c56..1bfa056f0c1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache @@ -1 +1 @@ -{{#returnContainer}}{{{returnContainer}}}<{{/returnContainer}}{{{returnType}}}{{#returnContainer}}>{{/returnContainer}} \ No newline at end of file +{{{returnType}}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java index c0359617b45..9cf02d621bc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -23,5 +23,5 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", notes = "To test special tags", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testSpecialTags(@Valid Client body); + Client testSpecialTags(@Valid Client body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java index cc205a1d9b9..e9c28d5da5f 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java @@ -25,28 +25,28 @@ public interface FakeApi { @ApiOperation(value = "", notes = "Test serialization of outer boolean types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + Boolean fakeOuterBooleanSerialize(@Valid Boolean body) throws Exception; @POST @Path("/outer/composite") @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body); + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body) throws Exception; @POST @Path("/outer/number") @ApiOperation(value = "", notes = "Test serialization of outer number types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body) throws Exception; @POST @Path("/outer/string") @ApiOperation(value = "", notes = "Test serialization of outer string types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - String fakeOuterStringSerialize(@Valid String body); + String fakeOuterStringSerialize(@Valid String body) throws Exception; @PATCH @Consumes({ "application/json" }) @@ -54,7 +54,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClientModel(@Valid Client body); + Client testClientModel(@Valid Client body) throws Exception; @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @@ -65,7 +65,7 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback); + void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) throws Exception; @GET @Consumes({ "*/*" }) @@ -74,7 +74,7 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble); + void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) throws Exception; @GET @Path("/jsonFormData") @@ -82,5 +82,5 @@ public interface FakeApi { @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 710ea4c9b90..7a1df7ea2e2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -24,5 +24,5 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClassname(@Valid Client body); + Client testClassname(@Valid Client body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java index bd166d62b7f..271d68edbdc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void addPet(@Valid Pet body); + void addPet(@Valid Pet body) throws Exception; @DELETE @Path("/{petId}") @@ -42,7 +42,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) throws Exception; @GET @Path("/findByStatus") @@ -56,7 +56,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - List> findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + List findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) throws Exception; @GET @Path("/findByTags") @@ -70,7 +70,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - List> findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + List findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) throws Exception; @GET @Path("/{petId}") @@ -82,7 +82,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId); + Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) throws Exception; @PUT @Consumes({ "application/json", "application/xml" }) @@ -97,7 +97,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - void updatePet(@Valid Pet body); + void updatePet(@Valid Pet body) throws Exception; @POST @Path("/{petId}") @@ -111,7 +111,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status); + void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) throws Exception; @POST @Path("/{petId}/uploadImage") @@ -126,5 +126,5 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail); + @FormParam(value = "file") Attachment fileDetail) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java index ffa77a6cdc6..194e30dd955 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java @@ -24,7 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId); + void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) throws Exception; @GET @Path("/inventory") @@ -34,7 +34,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - Map> getInventory(); + Map getInventory() throws Exception; @GET @Path("/order/{order_id}") @@ -44,7 +44,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId); + Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) throws Exception; @POST @Path("/order") @@ -53,5 +53,5 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Order placeOrder(@Valid Order body); + Order placeOrder(@Valid Order body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java index d6c30a1f3dc..0619dbc57cd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java @@ -22,7 +22,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUser(@Valid User body); + void createUser(@Valid User body) throws Exception; @POST @Path("/createWithArray") @@ -30,7 +30,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithArrayInput(@Valid List body); + void createUsersWithArrayInput(@Valid List body) throws Exception; @POST @Path("/createWithList") @@ -38,7 +38,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithListInput(@Valid List body); + void createUsersWithListInput(@Valid List body) throws Exception; @DELETE @Path("/{username}") @@ -47,7 +47,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username); + void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) throws Exception; @GET @Path("/{username}") @@ -57,7 +57,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username); + User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) throws Exception; @GET @Path("/login") @@ -66,7 +66,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) throws Exception; @GET @Path("/logout") @@ -74,7 +74,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void logoutUser(); + void logoutUser() throws Exception; @PUT @Path("/{username}") @@ -83,5 +83,5 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); + void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) throws Exception; }