Merge pull request #1519 from swagger-api/issue-1518

remove duplicate tags, replace with extensions in templates
This commit is contained in:
Tony Tam 2015-11-06 06:22:08 -08:00
commit 5b80e95b96
23 changed files with 87 additions and 71 deletions

View File

@ -1,23 +1,12 @@
package io.swagger.codegen.languages; package io.swagger.codegen.languages;
import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.*;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenResponse;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.SupportingFile;
import io.swagger.models.Operation; import io.swagger.models.Operation;
import io.swagger.models.properties.Property; import io.swagger.models.Path;
import io.swagger.models.properties.StringProperty; import io.swagger.models.Swagger;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConfig { public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConfig {
protected String title = "Swagger Server"; protected String title = "Swagger Server";
@ -118,6 +107,36 @@ public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConf
co.baseName = basePath; co.baseName = basePath;
} }
@Override
public void preprocessSwagger(Swagger swagger) {
if(swagger != null && swagger.getPaths() != null) {
for(String pathname : swagger.getPaths().keySet()) {
Path path = swagger.getPath(pathname);
if(path.getOperations() != null) {
for(Operation operation : path.getOperations()) {
if(operation.getTags() != null) {
List<Map<String, String>> tags = new ArrayList<Map<String, String>>();
for(String tag : operation.getTags()) {
Map<String, String> value = new HashMap<String, String>();
value.put("tag", tag);
value.put("hasMore", "true");
tags.add(value);
}
if(tags.size() > 0) {
tags.get(tags.size() - 1).remove("hasMore");
}
if(operation.getTags().size() > 0) {
String tag = operation.getTags().get(0);
operation.setTags(Arrays.asList(tag));
}
operation.setVendorExtension("x-tags", tags);
}
}
}
}
}
}
@Override @Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) { public Map<String, Object> postProcessModels(Map<String, Object> objs) {
List<Object> models = (List<Object>) objs.get("models"); List<Object> models = (List<Object>) objs.get("models");
@ -195,9 +214,10 @@ public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConf
result = result.substring(0, ix) + "/impl" + result.substring(ix, result.length() - 5) + "ServiceImpl.java"; result = result.substring(0, ix) + "/impl" + result.substring(ix, result.length() - 5) + "ServiceImpl.java";
String output = System.getProperty("swagger.codegen.jaxrs.impl.source"); String output = System.getProperty("swagger.codegen.jaxrs.impl.source");
if (output != null) { if(output == null) {
result = result.replace(apiFileFolder(), implFileFolder(output)); output = "src" + File.separator + "main" + File.separator + "java";
} }
result = result.replace(apiFileFolder(), implFileFolder(output));
} else if (templateName.endsWith("Factory.mustache")) { } else if (templateName.endsWith("Factory.mustache")) {
int ix = result.lastIndexOf('/'); int ix = result.lastIndexOf('/');
result = result.substring(0, ix) + "/factories" + result.substring(ix, result.length() - 5) + "ServiceFactory.java"; result = result.substring(0, ix) + "/factories" + result.substring(ix, result.length() - 5) + "ServiceFactory.java";

View File

@ -22,14 +22,13 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("{{basePathWithoutHost}}/{{baseName}}") @Path("/{{baseName}}")
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}}
@io.swagger.annotations.Api(value = "/{{baseName}}", description = "the {{baseName}} API") @io.swagger.annotations.Api(description = "the {{baseName}} API")
{{>generatedAnnotation}} {{>generatedAnnotation}}
{{#operations}} {{#operations}}
public class {{classname}} { public class {{classname}} {
private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}(); private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}();
{{#operation}} {{#operation}}
@ -43,7 +42,7 @@ public class {{classname}} {
{{/hasMore}}{{/scopes}} {{/hasMore}}{{/scopes}}
}{{/isOAuth}}){{#hasMore}}, }{{/isOAuth}}){{#hasMore}},
{{/hasMore}}{{/authMethods}} {{/hasMore}}{{/authMethods}}
}{{/hasAuthMethods}}) }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} })
@io.swagger.annotations.ApiResponses(value = { {{#responses}} @io.swagger.annotations.ApiResponses(value = { {{#responses}}
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},
{{/hasMore}}{{/responses}} }) {{/hasMore}}{{/responses}} })

View File

@ -1,6 +1,6 @@
package io.swagger.api; package io.swagger.api;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class ApiException extends Exception{ public class ApiException extends Exception{
private int code; private int code;
public ApiException (int code, String msg) { public ApiException (int code, String msg) {

View File

@ -5,7 +5,7 @@ import java.io.IOException;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class ApiOriginFilter implements javax.servlet.Filter { public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -3,7 +3,7 @@ package io.swagger.api;
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement @javax.xml.bind.annotation.XmlRootElement
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class ApiResponseMessage { public class ApiResponseMessage {
public static final int ERROR = 1; public static final int ERROR = 1;
public static final int WARNING = 2; public static final int WARNING = 2;

View File

@ -1,6 +1,6 @@
package io.swagger.api; package io.swagger.api;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class NotFoundException extends ApiException { public class NotFoundException extends ApiException {
private int code; private int code;
public NotFoundException (int code, String msg) { public NotFoundException (int code, String msg) {

View File

@ -22,13 +22,12 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/v2/pet") @Path("/pet")
@io.swagger.annotations.Api(value = "/pet", description = "the pet API") @io.swagger.annotations.Api(description = "the pet API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class PetApi { public class PetApi {
private final PetApiService delegate = PetApiServiceFactory.getPetApi(); private final PetApiService delegate = PetApiServiceFactory.getPetApi();
@PUT @PUT
@ -40,7 +39,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ -61,7 +60,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
@ -78,7 +77,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ -97,7 +96,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ -113,7 +112,7 @@ public class PetApi {
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = {
@io.swagger.annotations.Authorization(value = "api_key") @io.swagger.annotations.Authorization(value = "api_key")
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ -134,7 +133,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
@ -153,7 +152,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
@ -171,7 +170,7 @@ public class PetApi {
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
}) })
}) }, tags={ "pet" })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public abstract class PetApiService { public abstract class PetApiService {
public abstract Response updatePet(Pet body) public abstract Response updatePet(Pet body)

View File

@ -22,13 +22,12 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/v2/store") @Path("/store")
@io.swagger.annotations.Api(value = "/store", description = "the store API") @io.swagger.annotations.Api(description = "the store API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class StoreApi { public class StoreApi {
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
@GET @GET
@ -37,7 +36,7 @@ public class StoreApi {
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@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 = {
@io.swagger.annotations.Authorization(value = "api_key") @io.swagger.annotations.Authorization(value = "api_key")
}) }, tags={ "store", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
@ -49,7 +48,7 @@ public class StoreApi {
@Path("/order") @Path("/order")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ -63,7 +62,7 @@ public class StoreApi {
@Path("/order/{orderId}") @Path("/order/{orderId}")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@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) @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.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ -79,7 +78,7 @@ public class StoreApi {
@Path("/order/{orderId}") @Path("/order/{orderId}")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@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) @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.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public abstract class StoreApiService { public abstract class StoreApiService {
public abstract Response getInventory() public abstract Response getInventory()

View File

@ -22,20 +22,19 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.*; import javax.ws.rs.*;
@Path("/v2/user") @Path("/user")
@io.swagger.annotations.Api(value = "/user", description = "the user API") @io.swagger.annotations.Api(description = "the user API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class UserApi { public class UserApi {
private final UserApiService delegate = UserApiServiceFactory.getUserApi(); private final UserApiService delegate = UserApiServiceFactory.getUserApi();
@POST @POST
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
@ -47,7 +46,7 @@ public class UserApi {
@Path("/createWithArray") @Path("/createWithArray")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
@ -59,7 +58,7 @@ public class UserApi {
@Path("/createWithList") @Path("/createWithList")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
@ -71,7 +70,7 @@ public class UserApi {
@Path("/login") @Path("/login")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class),
@ -86,7 +85,7 @@ public class UserApi {
@Path("/logout") @Path("/logout")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class) @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) })
@ -98,7 +97,7 @@ public class UserApi {
@Path("/{username}") @Path("/{username}")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class),
@ -114,7 +113,7 @@ public class UserApi {
@Path("/{username}") @Path("/{username}")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class) @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.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
@ -129,7 +128,7 @@ public class UserApi {
@Path("/{username}") @Path("/{username}")
@Produces({ "application/json", "application/xml" }) @Produces({ "application/json", "application/xml" })
@io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class) @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.ApiResponses(value = { @io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public abstract class UserApiService { public abstract class UserApiService {
public abstract Response createUser(User body) public abstract Response createUser(User body)

View File

@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;

View File

@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;

View File

@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;

View File

@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;

View File

@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:51:39.623-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class User { public class User {
private Long id = null; private Long id = null;

View File

@ -3,7 +3,7 @@ package io.swagger.api.factories;
import io.swagger.api.PetApiService; import io.swagger.api.PetApiService;
import io.swagger.api.impl.PetApiServiceImpl; import io.swagger.api.impl.PetApiServiceImpl;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class PetApiServiceFactory { public class PetApiServiceFactory {
private final static PetApiService service = new PetApiServiceImpl(); private final static PetApiService service = new PetApiServiceImpl();

View File

@ -3,7 +3,7 @@ package io.swagger.api.factories;
import io.swagger.api.StoreApiService; import io.swagger.api.StoreApiService;
import io.swagger.api.impl.StoreApiServiceImpl; import io.swagger.api.impl.StoreApiServiceImpl;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class StoreApiServiceFactory { public class StoreApiServiceFactory {
private final static StoreApiService service = new StoreApiServiceImpl(); private final static StoreApiService service = new StoreApiServiceImpl();

View File

@ -3,7 +3,7 @@ package io.swagger.api.factories;
import io.swagger.api.UserApiService; import io.swagger.api.UserApiService;
import io.swagger.api.impl.UserApiServiceImpl; import io.swagger.api.impl.UserApiServiceImpl;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class UserApiServiceFactory { public class UserApiServiceFactory {
private final static UserApiService service = new UserApiServiceImpl(); private final static UserApiService service = new UserApiServiceImpl();

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class PetApiServiceImpl extends PetApiService { public class PetApiServiceImpl extends PetApiService {
@Override @Override

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class StoreApiServiceImpl extends StoreApiService { public class StoreApiServiceImpl extends StoreApiService {
@Override @Override

View File

@ -18,7 +18,7 @@ import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T18:43:02.375-08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2015-11-05T22:31:25.130-08:00")
public class UserApiServiceImpl extends UserApiService { public class UserApiServiceImpl extends UserApiService {
@Override @Override