Fix subResourcePath when using tags in java-jersey (#215)

This commit is contained in:
Thomas Townsend 2018-06-30 09:23:04 +01:00 committed by Jérémie Bresson
parent 1f1a47c57b
commit 79856abae9
11 changed files with 63 additions and 50 deletions

View File

@ -159,6 +159,19 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
@Override @Override
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations) { public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations) {
if (useTags) { if (useTags) {
String basePath = resourcePath;
if (basePath.startsWith("/")) {
basePath = basePath.substring(1);
}
int pos = basePath.indexOf("/");
if (pos > 0) {
basePath = basePath.substring(0, pos);
}
if (co.path.startsWith("/" + basePath)) {
co.path = co.path.substring(("/" + basePath).length());
}
co.subresourceOperation = !co.path.isEmpty();
super.addOperationToGroup(tag, resourcePath, operation, co, operations); super.addOperationToGroup(tag, resourcePath, operation, co, operations);
} else { } else {
String basePath = resourcePath; String basePath = resourcePath;

View File

@ -35,7 +35,7 @@ public class AnotherFakeApi {
private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi();
@PATCH @PATCH
@Path("/dummy")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" })

View File

@ -41,7 +41,7 @@ public class FakeApi {
private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi();
@POST @POST
@Path("/outer/boolean")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
@ -54,7 +54,7 @@ public class FakeApi {
return delegate.fakeOuterBooleanSerialize(body,securityContext); return delegate.fakeOuterBooleanSerialize(body,securityContext);
} }
@POST @POST
@Path("/outer/composite")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
@ -67,7 +67,7 @@ public class FakeApi {
return delegate.fakeOuterCompositeSerialize(outerComposite,securityContext); return delegate.fakeOuterCompositeSerialize(outerComposite,securityContext);
} }
@POST @POST
@Path("/outer/number")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
@ -80,7 +80,7 @@ public class FakeApi {
return delegate.fakeOuterNumberSerialize(body,securityContext); return delegate.fakeOuterNumberSerialize(body,securityContext);
} }
@POST @POST
@Path("/outer/string")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
@ -93,7 +93,7 @@ public class FakeApi {
return delegate.fakeOuterStringSerialize(body,securityContext); return delegate.fakeOuterStringSerialize(body,securityContext);
} }
@PUT @PUT
@Path("/body-with-query-params")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", })
@ -171,7 +171,7 @@ public class FakeApi {
return delegate.testEnumParameters(enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,enumFormStringArray,enumFormString,securityContext); return delegate.testEnumParameters(enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,enumFormStringArray,enumFormString,securityContext);
} }
@POST @POST
@Path("/inline-additionalProperties")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", })
@ -184,7 +184,7 @@ public class FakeApi {
return delegate.testInlineAdditionalProperties(requestBody,securityContext); return delegate.testInlineAdditionalProperties(requestBody,securityContext);
} }
@GET @GET
@Path("/jsonFormData")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" })

View File

@ -55,7 +55,7 @@ public class PetApi {
return delegate.addPet(pet,securityContext); return delegate.addPet(pet,securityContext);
} }
@DELETE @DELETE
@Path("/{petId}")
@io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
@ -74,7 +74,7 @@ public class PetApi {
return delegate.deletePet(petId,apiKey,securityContext); return delegate.deletePet(petId,apiKey,securityContext);
} }
@GET @GET
@Path("/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
@ -93,7 +93,7 @@ public class PetApi {
return delegate.findPetsByStatus(status,securityContext); return delegate.findPetsByStatus(status,securityContext);
} }
@GET @GET
@Path("/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
@ -112,7 +112,7 @@ public class PetApi {
return delegate.findPetsByTags(tags,securityContext); return delegate.findPetsByTags(tags,securityContext);
} }
@GET @GET
@Path("/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
@ -149,7 +149,7 @@ public class PetApi {
return delegate.updatePet(pet,securityContext); return delegate.updatePet(pet,securityContext);
} }
@POST @POST
@Path("/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
@ -169,7 +169,7 @@ public class PetApi {
return delegate.updatePetWithForm(petId,name,status,securityContext); return delegate.updatePetWithForm(petId,name,status,securityContext);
} }
@POST @POST
@Path("/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {

View File

@ -36,7 +36,7 @@ public class StoreApi {
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
@DELETE @DELETE
@Path("/order/{order_id}")
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", })
@ -50,7 +50,7 @@ public class StoreApi {
return delegate.deleteOrder(orderId,securityContext); return delegate.deleteOrder(orderId,securityContext);
} }
@GET @GET
@Path("/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
@ -64,7 +64,7 @@ public class StoreApi {
return delegate.getInventory(securityContext); return delegate.getInventory(securityContext);
} }
@GET @GET
@Path("/order/{order_id}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.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", }) @io.swagger.annotations.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", })
@ -79,7 +79,7 @@ public class StoreApi {
return delegate.getOrderById(orderId,securityContext); return delegate.getOrderById(orderId,securityContext);
} }
@POST @POST
@Path("/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" })

View File

@ -49,7 +49,7 @@ public class UserApi {
return delegate.createUser(user,securityContext); return delegate.createUser(user,securityContext);
} }
@POST @POST
@Path("/createWithArray")
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@ -62,7 +62,7 @@ public class UserApi {
return delegate.createUsersWithArrayInput(user,securityContext); return delegate.createUsersWithArrayInput(user,securityContext);
} }
@POST @POST
@Path("/createWithList")
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@ -75,7 +75,7 @@ public class UserApi {
return delegate.createUsersWithListInput(user,securityContext); return delegate.createUsersWithListInput(user,securityContext);
} }
@DELETE @DELETE
@Path("/{username}")
@io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
@ -89,7 +89,7 @@ public class UserApi {
return delegate.deleteUser(username,securityContext); return delegate.deleteUser(username,securityContext);
} }
@GET @GET
@Path("/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
@ -104,7 +104,7 @@ public class UserApi {
return delegate.getUserByName(username,securityContext); return delegate.getUserByName(username,securityContext);
} }
@GET @GET
@Path("/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
@ -119,7 +119,7 @@ public class UserApi {
return delegate.loginUser(username,password,securityContext); return delegate.loginUser(username,password,securityContext);
} }
@GET @GET
@Path("/logout")
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
@ -131,7 +131,7 @@ public class UserApi {
return delegate.logoutUser(securityContext); return delegate.logoutUser(securityContext);
} }
@PUT @PUT
@Path("/{username}")
@io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })

View File

@ -55,7 +55,7 @@ public class AnotherFakeApi {
} }
@PATCH @PATCH
@Path("/dummy")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", })

View File

@ -61,7 +61,7 @@ public class FakeApi {
} }
@POST @POST
@Path("/outer/boolean")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
@ -73,7 +73,7 @@ public class FakeApi {
return delegate.fakeOuterBooleanSerialize(body,securityContext); return delegate.fakeOuterBooleanSerialize(body,securityContext);
} }
@POST @POST
@Path("/outer/composite")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
@ -85,7 +85,7 @@ public class FakeApi {
return delegate.fakeOuterCompositeSerialize(outerComposite,securityContext); return delegate.fakeOuterCompositeSerialize(outerComposite,securityContext);
} }
@POST @POST
@Path("/outer/number")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
@ -97,7 +97,7 @@ public class FakeApi {
return delegate.fakeOuterNumberSerialize(body,securityContext); return delegate.fakeOuterNumberSerialize(body,securityContext);
} }
@POST @POST
@Path("/outer/string")
@Produces({ "*/*" }) @Produces({ "*/*" })
@io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
@ -109,7 +109,7 @@ public class FakeApi {
return delegate.fakeOuterStringSerialize(body,securityContext); return delegate.fakeOuterStringSerialize(body,securityContext);
} }
@PUT @PUT
@Path("/body-with-query-params")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", })
@ -186,7 +186,7 @@ public class FakeApi {
return delegate.testEnumParameters(enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,enumFormStringArray,enumFormString,securityContext); return delegate.testEnumParameters(enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,enumFormStringArray,enumFormString,securityContext);
} }
@POST @POST
@Path("/inline-additionalProperties")
@Consumes({ "application/json" }) @Consumes({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", })
@ -198,7 +198,7 @@ public class FakeApi {
return delegate.testInlineAdditionalProperties(requestBody,securityContext); return delegate.testInlineAdditionalProperties(requestBody,securityContext);
} }
@GET @GET
@Path("/jsonFormData")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", })

View File

@ -74,7 +74,7 @@ public class PetApi {
return delegate.addPet(pet,securityContext); return delegate.addPet(pet,securityContext);
} }
@DELETE @DELETE
@Path("/{petId}")
@io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
@ -92,7 +92,7 @@ public class PetApi {
return delegate.deletePet(petId,apiKey,securityContext); return delegate.deletePet(petId,apiKey,securityContext);
} }
@GET @GET
@Path("/findByStatus")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
@ -111,7 +111,7 @@ public class PetApi {
return delegate.findPetsByStatus(status,securityContext); return delegate.findPetsByStatus(status,securityContext);
} }
@GET @GET
@Path("/findByTags")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
@ -130,7 +130,7 @@ public class PetApi {
return delegate.findPetsByTags(tags,securityContext); return delegate.findPetsByTags(tags,securityContext);
} }
@GET @GET
@Path("/{petId}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
@ -169,7 +169,7 @@ public class PetApi {
return delegate.updatePet(pet,securityContext); return delegate.updatePet(pet,securityContext);
} }
@POST @POST
@Path("/{petId}")
@Consumes({ "application/x-www-form-urlencoded" }) @Consumes({ "application/x-www-form-urlencoded" })
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
@ -188,7 +188,7 @@ public class PetApi {
return delegate.updatePetWithForm(petId,name,status,securityContext); return delegate.updatePetWithForm(petId,name,status,securityContext);
} }
@POST @POST
@Path("/{petId}/uploadImage")
@Consumes({ "multipart/form-data" }) @Consumes({ "multipart/form-data" })
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {

View File

@ -56,7 +56,7 @@ public class StoreApi {
} }
@DELETE @DELETE
@Path("/order/{order_id}")
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", })
@ -70,7 +70,7 @@ public class StoreApi {
return delegate.deleteOrder(orderId,securityContext); return delegate.deleteOrder(orderId,securityContext);
} }
@GET @GET
@Path("/inventory")
@Produces({ "application/json" }) @Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
@ -83,7 +83,7 @@ public class StoreApi {
return delegate.getInventory(securityContext); return delegate.getInventory(securityContext);
} }
@GET @GET
@Path("/order/{order_id}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.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", }) @io.swagger.annotations.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", })
@ -99,7 +99,7 @@ public class StoreApi {
return delegate.getOrderById(orderId,securityContext); return delegate.getOrderById(orderId,securityContext);
} }
@POST @POST
@Path("/order")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })

View File

@ -68,7 +68,7 @@ public class UserApi {
return delegate.createUser(user,securityContext); return delegate.createUser(user,securityContext);
} }
@POST @POST
@Path("/createWithArray")
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@ -80,7 +80,7 @@ public class UserApi {
return delegate.createUsersWithArrayInput(user,securityContext); return delegate.createUsersWithArrayInput(user,securityContext);
} }
@POST @POST
@Path("/createWithList")
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@ -92,7 +92,7 @@ public class UserApi {
return delegate.createUsersWithListInput(user,securityContext); return delegate.createUsersWithListInput(user,securityContext);
} }
@DELETE @DELETE
@Path("/{username}")
@io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
@ -106,7 +106,7 @@ public class UserApi {
return delegate.deleteUser(username,securityContext); return delegate.deleteUser(username,securityContext);
} }
@GET @GET
@Path("/{username}")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
@ -122,7 +122,7 @@ public class UserApi {
return delegate.getUserByName(username,securityContext); return delegate.getUserByName(username,securityContext);
} }
@GET @GET
@Path("/login")
@Produces({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" })
@io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
@ -137,7 +137,7 @@ public class UserApi {
return delegate.loginUser(username,password,securityContext); return delegate.loginUser(username,password,securityContext);
} }
@GET @GET
@Path("/logout")
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
@ -148,7 +148,7 @@ public class UserApi {
return delegate.logoutUser(securityContext); return delegate.logoutUser(securityContext);
} }
@PUT @PUT
@Path("/{username}")
@io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })