Skip to content

Commit

Permalink
JAXRS-SPEC: fix container return type (#6659)
Browse files Browse the repository at this point in the history
* JAXRS-SPEC: fix container return type

* Run
./bin/jaxrs-spec-petstore-server.sh
./bin/jaxrs-spec-petstore-server-interface.sh
  • Loading branch information
carnevalegiacomo authored and wing328 committed Oct 17, 2017
1 parent 5143fb5 commit abe1be1
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}});
{{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) throws Exception;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#returnContainer}}{{{returnContainer}}}<{{/returnContainer}}{{{returnType}}}{{#returnContainer}}>{{/returnContainer}}
{{{returnType}}}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@ 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" })
@Produces({ "application/json" })
@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" })
Expand All @@ -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({ "*/*" })
Expand All @@ -74,13 +74,13 @@ 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<String> enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List<String> 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<String> 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<String> enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List<String> 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<String> 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")
@Consumes({ "application/json" })
@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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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")
Expand All @@ -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<List<Pet>> findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List<String> status);
List<Pet> findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List<String> status) throws Exception;

@GET
@Path("/findByTags")
Expand All @@ -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<List<Pet>> findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List<String> tags);
List<Pet> findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List<String> tags) throws Exception;

@GET
@Path("/{petId}")
Expand All @@ -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" })
Expand All @@ -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}")
Expand All @@ -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")
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -34,7 +34,7 @@ public interface StoreApi {
}, tags={ "store", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
Map<Map<String, Integer>> getInventory();
Map<String, Integer> getInventory() throws Exception;

@GET
@Path("/order/{order_id}")
Expand All @@ -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")
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ 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")
@Produces({ "application/xml", "application/json" })
@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<User> body);
void createUsersWithArrayInput(@Valid List<User> body) throws Exception;

@POST
@Path("/createWithList")
@Produces({ "application/xml", "application/json" })
@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<User> body);
void createUsersWithListInput(@Valid List<User> body) throws Exception;

@DELETE
@Path("/{username}")
Expand All @@ -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}")
Expand All @@ -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")
Expand All @@ -66,15 +66,15 @@ 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")
@Produces({ "application/xml", "application/json" })
@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}")
Expand All @@ -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;
}

0 comments on commit abe1be1

Please sign in to comment.