forked from loafle/openapi-generator-original
fix bug related to api, model doc for java server generator
This commit is contained in:
parent
fb04bb7d4d
commit
a63dbeb4c8
@ -25,6 +25,15 @@ public abstract class AbstractJavaJAXRSServerCodegen extends JavaClientCodegen
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
// clear model and api doc template as AbstractJavaJAXRSServerCodegen
|
||||
// does not support auto-generated markdown doc at the moment
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
}
|
||||
|
||||
// ================
|
||||
// ABSTRACT METHODS
|
||||
// ================
|
||||
|
@ -70,6 +70,11 @@ public class JavaInflectorServerCodegen extends JavaClientCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// clear model and api doc template as this codegen
|
||||
// does not support auto-generated markdown doc at the moment
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
|
||||
supportingFiles.clear();
|
||||
writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||
writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md"));
|
||||
|
@ -20,6 +20,7 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
apiTemplateFiles.put("apiService.mustache", ".java");
|
||||
apiTemplateFiles.put("apiServiceImpl.mustache", ".java");
|
||||
apiTemplateFiles.put("apiServiceFactory.mustache", ".java");
|
||||
|
||||
apiPackage = "io.swagger.api";
|
||||
modelPackage = "io.swagger.model";
|
||||
|
||||
@ -72,6 +73,11 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// clear model and api doc template as this codegen
|
||||
// does not support auto-generated markdown doc at the moment
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
|
||||
if ( additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER) ) {
|
||||
implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER);
|
||||
}
|
||||
|
@ -84,6 +84,11 @@ public class JavaResteasyServerCodegen extends JavaClientCodegen implements Code
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// clear model and api doc template as AbstractJavaJAXRSServerCodegen
|
||||
// does not support auto-generated markdown doc at the moment
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) {
|
||||
implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER);
|
||||
}
|
||||
|
@ -59,6 +59,11 @@ public class SpringMVCServerCodegen extends JavaClientCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// clear model and api doc template as this codegen
|
||||
// does not support auto-generated markdown doc at the moment
|
||||
modelDocTemplateFiles.remove("model_doc.mustache");
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
|
||||
if (additionalProperties.containsKey(CONFIG_PACKAGE)) {
|
||||
this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE));
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
@ -3,6 +3,10 @@ package io.swagger.api;
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
@ -3,6 +3,10 @@ package io.swagger.api;
|
||||
import io.swagger.model.User;
|
||||
import java.util.List;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
@ -8,9 +8,10 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder =
|
||||
@XmlType(name = "Category", propOrder =
|
||||
{ "id", "name"
|
||||
})
|
||||
|
||||
|
@ -8,9 +8,10 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder =
|
||||
@XmlType(name = "Order", propOrder =
|
||||
{ "id", "petId", "quantity", "shipDate", "status", "complete"
|
||||
})
|
||||
|
||||
@ -26,19 +27,24 @@ public class Order {
|
||||
|
||||
private javax.xml.datatype.XMLGregorianCalendar shipDate = null;
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlType(name="Order")
|
||||
@XmlType(name="StatusEnum")
|
||||
@XmlEnum
|
||||
public enum Order {
|
||||
{values=[placed, approved, delivered], enumVars=[{name=PLACED, value=placed}, {name=APPROVED, value=approved}, {name=DELIVERED, value=delivered}]},
|
||||
public enum StatusEnum {
|
||||
|
||||
public String value() {
|
||||
return name();
|
||||
PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered"));
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum (String v) {
|
||||
value = v;
|
||||
}
|
||||
|
||||
public static Order fromValue(String v) {
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StatusEnum fromValue(String v) {
|
||||
return valueOf(v);
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,10 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder =
|
||||
@XmlType(name = "Pet", propOrder =
|
||||
{ "id", "category", "name", "photoUrls", "tags", "status"
|
||||
})
|
||||
|
||||
@ -32,19 +33,24 @@ public class Pet {
|
||||
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlType(name="Pet")
|
||||
@XmlType(name="StatusEnum")
|
||||
@XmlEnum
|
||||
public enum Pet {
|
||||
{values=[available, pending, sold], enumVars=[{name=AVAILABLE, value=available}, {name=PENDING, value=pending}, {name=SOLD, value=sold}]},
|
||||
public enum StatusEnum {
|
||||
|
||||
public String value() {
|
||||
return name();
|
||||
AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold"));
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum (String v) {
|
||||
value = v;
|
||||
}
|
||||
|
||||
public static Pet fromValue(String v) {
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StatusEnum fromValue(String v) {
|
||||
return valueOf(v);
|
||||
}
|
||||
}
|
||||
|
@ -8,9 +8,10 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder =
|
||||
@XmlType(name = "Tag", propOrder =
|
||||
{ "id", "name"
|
||||
})
|
||||
|
||||
|
@ -8,9 +8,10 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "", propOrder =
|
||||
@XmlType(name = "User", propOrder =
|
||||
{ "id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"
|
||||
})
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.api;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class ApiException extends Exception{
|
||||
private int code;
|
||||
public ApiException (int code, String msg) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.api;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
@javax.xml.bind.annotation.XmlRootElement
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class ApiResponseMessage {
|
||||
public static final int ERROR = 1;
|
||||
public static final int WARNING = 2;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.api;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class NotFoundException extends ApiException {
|
||||
private int code;
|
||||
public NotFoundException (int code, String msg) {
|
||||
|
@ -5,8 +5,8 @@ import io.swagger.api.PetApiService;
|
||||
import io.swagger.api.factories.PetApiServiceFactory;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
@Path("/pet")
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class PetApi {
|
||||
private final PetApiService delegate = PetApiServiceFactory.getPetApi();
|
||||
|
||||
|
@ -6,8 +6,8 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
||||
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
@ -17,7 +17,7 @@ import java.io.InputStream;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public abstract class PetApiService {
|
||||
public abstract Response addPet(Pet body,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
|
@ -20,7 +20,7 @@ import javax.ws.rs.*;
|
||||
@Path("/store")
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class StoreApi {
|
||||
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.io.InputStream;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public abstract class StoreApiService {
|
||||
public abstract Response deleteOrder(String orderId,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.api;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class StringUtil {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -20,7 +20,7 @@ import javax.ws.rs.*;
|
||||
@Path("/user")
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class UserApi {
|
||||
private final UserApiService delegate = UserApiServiceFactory.getUserApi();
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.io.InputStream;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public abstract class UserApiService {
|
||||
public abstract Response createUser(User body,SecurityContext securityContext)
|
||||
throws NotFoundException;
|
||||
|
@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class Category {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class Order {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class Pet {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class Tag {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-22T16:59:08.714+08:00")
|
||||
public class User {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -9,8 +9,8 @@ import io.swagger.annotations.ApiParam;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
@ -169,14 +169,14 @@ public class PetApi {
|
||||
@Path("/{petId}/uploadImage")
|
||||
@Consumes({ "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ApiResponse.class, authorizations = {
|
||||
@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}, tags={ "pet" })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ApiResponse.class) })
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
public Response uploadFile(
|
||||
@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId,
|
||||
@FormDataParam("additionalMetadata") String additionalMetadata,
|
||||
|
@ -6,8 +6,8 @@ import io.swagger.model.*;
|
||||
import com.sun.jersey.multipart.FormDataParam;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.api;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class ApiException extends Exception{
|
||||
private int code;
|
||||
public ApiException (int code, String msg) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.api;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
@javax.xml.bind.annotation.XmlRootElement
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class ApiResponseMessage {
|
||||
public static final int ERROR = 1;
|
||||
public static final int WARNING = 2;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.api;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class NotFoundException extends ApiException {
|
||||
private int code;
|
||||
public NotFoundException (int code, String msg) {
|
||||
|
@ -3,8 +3,8 @@ package io.swagger.api;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import io.swagger.model.ApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -32,7 +32,7 @@ import static org.springframework.http.MediaType.*;
|
||||
@Controller
|
||||
@RequestMapping(value = "/pet", produces = {APPLICATION_JSON_VALUE})
|
||||
@Api(value = "/pet", description = "the pet API")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class PetApi {
|
||||
|
||||
@ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = {
|
||||
@ -206,19 +206,19 @@ public class PetApi {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ApiResponse.class, authorizations = {
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@Authorization(value = "petstore_auth", scopes = {
|
||||
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
})
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ApiResponse.class) })
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
@RequestMapping(value = "/{petId}/uploadImage",
|
||||
produces = { "application/json" },
|
||||
consumes = { "multipart/form-data" },
|
||||
method = RequestMethod.POST)
|
||||
public ResponseEntity<ApiResponse> uploadFile(
|
||||
public ResponseEntity<ModelApiResponse> uploadFile(
|
||||
@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId
|
||||
|
||||
,
|
||||
@ -233,7 +233,7 @@ public class PetApi {
|
||||
)
|
||||
throws NotFoundException {
|
||||
// do some magic!
|
||||
return new ResponseEntity<ApiResponse>(HttpStatus.OK);
|
||||
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import static org.springframework.http.MediaType.*;
|
||||
@Controller
|
||||
@RequestMapping(value = "/store", produces = {APPLICATION_JSON_VALUE})
|
||||
@Api(value = "/store", description = "the store API")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class StoreApi {
|
||||
|
||||
@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)
|
||||
|
@ -31,7 +31,7 @@ import static org.springframework.http.MediaType.*;
|
||||
@Controller
|
||||
@RequestMapping(value = "/user", produces = {APPLICATION_JSON_VALUE})
|
||||
@Api(value = "/user", description = "the user API")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class UserApi {
|
||||
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class)
|
||||
|
@ -18,7 +18,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableSwagger2 //Loads the spring beans required by the framework
|
||||
@PropertySource("classpath:swagger.properties")
|
||||
@Import(SwaggerUiConfiguration.class)
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
ApiInfo apiInfo() {
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
|
||||
private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
|
||||
|
||||
|
@ -2,7 +2,7 @@ package io.swagger.configuration;
|
||||
|
||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
|
||||
|
||||
@Override
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.configuration;
|
||||
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
||||
@Override
|
||||
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
||||
|
@ -11,7 +11,7 @@ import java.util.Objects;
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class Category {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -13,7 +13,7 @@ import java.util.Objects;
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class Order {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -16,7 +16,7 @@ import java.util.Objects;
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class Pet {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -11,7 +11,7 @@ import java.util.Objects;
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class Tag {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -11,7 +11,7 @@ import java.util.Objects;
|
||||
|
||||
|
||||
@ApiModel(description = "")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:49:05.879+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-22T17:03:40.798+08:00")
|
||||
public class User {
|
||||
|
||||
private Long id = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user