Merge pull request #1309 from wing328/fix_springmvc_object

[SpringMVC] fix compilation error by removing import of Object
This commit is contained in:
wing328 2015-10-01 10:02:20 +08:00
commit 253c46a0d5
36 changed files with 87 additions and 49 deletions

View File

@ -12,6 +12,7 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Iterator;
public class SpringMVCServerCodegen extends JavaClientCodegen implements CodegenConfig { public class SpringMVCServerCodegen extends JavaClientCodegen implements CodegenConfig {
protected String invokerPackage = "io.swagger.api"; protected String invokerPackage = "io.swagger.api";
@ -187,5 +188,17 @@ public class SpringMVCServerCodegen extends JavaClientCodegen implements Codegen
public void setConfigPackage(String configPackage) { public void setConfigPackage(String configPackage) {
this.configPackage = configPackage; this.configPackage = configPackage;
} }
@Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
// remove the import of "Object" to avoid compilation error
List<Map<String, String>> imports = (List<Map<String, String>>) objs.get("imports");
Iterator<Map<String, String>> iterator = imports.iterator();
while (iterator.hasNext()) {
String _import = iterator.next().get("import");
if (_import.endsWith(".Object")) iterator.remove();
}
return objs;
}
} }

View File

@ -39,7 +39,7 @@ import io.swagger.client.auth.HttpBasicAuth;
import io.swagger.client.auth.ApiKeyAuth; import io.swagger.client.auth.ApiKeyAuth;
import io.swagger.client.auth.OAuth; import io.swagger.client.auth.OAuth;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-24T21:52:56.159+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class ApiClient { public class ApiClient {
private Map<String, Client> hostMap = new HashMap<String, Client>(); private Map<String, Client> hostMap = new HashMap<String, Client>();
private Map<String, String> defaultHeaderMap = new HashMap<String, String>(); private Map<String, String> defaultHeaderMap = new HashMap<String, String>();

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class ApiException extends Exception { public class ApiException extends Exception {
private int code = 0; private int code = 0;
private Map<String, List<String>> responseHeaders = null; private Map<String, List<String>> responseHeaders = null;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Configuration { public class Configuration {
private static ApiClient defaultApiClient = new ApiClient(); private static ApiClient defaultApiClient = new ApiClient();

View File

@ -6,7 +6,7 @@ import com.fasterxml.jackson.datatype.joda.*;
import java.io.IOException; import java.io.IOException;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class JSON { public class JSON {
private ObjectMapper mapper; private ObjectMapper mapper;

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Pair { public class Pair {
private String name = ""; private String name = "";
private String value = ""; private String value = "";

View File

@ -1,6 +1,6 @@
package io.swagger.client; package io.swagger.client;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class StringUtil { public class StringUtil {
/** /**
* Check if the given array contains the given value (with case-insensitive comparison). * Check if the given array contains the given value (with case-insensitive comparison).

View File

@ -3,7 +3,7 @@ package io.swagger.client;
import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class TypeRef<T> { public class TypeRef<T> {
private final Type type; private final Type type;

View File

@ -17,7 +17,7 @@ import java.io.File;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class PetApi { public class PetApi {
private ApiClient apiClient; private ApiClient apiClient;
@ -272,7 +272,7 @@ public class PetApi {
}; };
final String contentType = apiClient.selectHeaderContentType(contentTypes); final String contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "petstore_auth", "api_key" }; String[] authNames = new String[] { "api_key", "petstore_auth" };

View File

@ -17,7 +17,7 @@ import java.io.File;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class StoreApi { public class StoreApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -17,7 +17,7 @@ import java.io.File;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class UserApi { public class UserApi {
private ApiClient apiClient; private ApiClient apiClient;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class ApiKeyAuth implements Authentication { public class ApiKeyAuth implements Authentication {
private final String location; private final String location;
private final String paramName; private final String paramName;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public interface Authentication { public interface Authentication {
/** Apply authentication settings to header and query params. */ /** Apply authentication settings to header and query params. */
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams); void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);

View File

@ -8,7 +8,7 @@ import java.util.List;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class HttpBasicAuth implements Authentication { public class HttpBasicAuth implements Authentication {
private String username; private String username;
private String password; private String password;

View File

@ -5,7 +5,7 @@ import io.swagger.client.Pair;
import java.util.Map; import java.util.Map;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class OAuth implements Authentication { public class OAuth implements Authentication {
@Override @Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) { public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {

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.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;

View File

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-21T17:24:54.566+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;

View File

@ -2,8 +2,8 @@ package io.swagger.client.model;
import io.swagger.client.StringUtil; import io.swagger.client.StringUtil;
import io.swagger.client.model.Category; import io.swagger.client.model.Category;
import java.util.*;
import io.swagger.client.model.Tag; import io.swagger.client.model.Tag;
import java.util.*;
@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ApiModel(description = "") @ApiModel(description = "")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-21T17:24:54.566+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Pet { public class Pet {
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.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class Tag { public class Tag {
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.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-30T16:27:52.437+08:00")
public class User { public class User {
private Long id = null; private Long id = null;

View File

@ -1,6 +1,6 @@
package io.swagger.api; package io.swagger.api;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class ApiOriginFilter implements javax.servlet.Filter { public class ApiOriginFilter implements javax.servlet.Filter {
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,

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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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

@ -30,7 +30,7 @@ import static org.springframework.http.MediaType.*;
@Controller @Controller
@RequestMapping(value = "/pet", produces = {APPLICATION_JSON_VALUE}) @RequestMapping(value = "/pet", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/pet", description = "the pet API") @Api(value = "/pet", description = "the pet API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class PetApi { public class PetApi {
@ -45,7 +45,8 @@ public class PetApi {
method = RequestMethod.PUT) method = RequestMethod.PUT)
public ResponseEntity<Void> updatePet( public ResponseEntity<Void> updatePet(
@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) @ApiParam(value = "Pet object that needs to be added to the store" ) Pet body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -62,7 +63,8 @@ public class PetApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> addPet( public ResponseEntity<Void> addPet(
@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) @ApiParam(value = "Pet object that needs to be added to the store" ) Pet body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -80,6 +82,7 @@ public class PetApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<List<Pet>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List<String> status public ResponseEntity<List<Pet>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List<String> status
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -98,6 +101,7 @@ public class PetApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<List<Pet>> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List<String> tags public ResponseEntity<List<Pet>> findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List<String> tags
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -117,6 +121,7 @@ public class PetApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<Pet> getPetById( public ResponseEntity<Pet> getPetById(
@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId @ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -134,15 +139,18 @@ public class PetApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> updatePetWithForm( public ResponseEntity<Void> updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId @ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId
, ,
@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name
,
@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -159,9 +167,11 @@ public class PetApi {
method = RequestMethod.DELETE) method = RequestMethod.DELETE)
public ResponseEntity<Void> deletePet( public ResponseEntity<Void> deletePet(
@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId @ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId
, ,
@ApiParam(value = "" ) @RequestHeader(value="apiKey", required=false) String apiKey @ApiParam(value = "" ) @RequestHeader(value="apiKey", required=false) String apiKey
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -179,14 +189,17 @@ public class PetApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> uploadFile( public ResponseEntity<Void> uploadFile(
@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId @ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId
, ,
@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata
,
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile fileDetail) @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);

View File

@ -30,7 +30,7 @@ import static org.springframework.http.MediaType.*;
@Controller @Controller
@RequestMapping(value = "/store", produces = {APPLICATION_JSON_VALUE}) @RequestMapping(value = "/store", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/store", description = "the store API") @Api(value = "/store", description = "the store API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class StoreApi { public class StoreApi {
@ -59,7 +59,8 @@ public class StoreApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Order> placeOrder( public ResponseEntity<Order> placeOrder(
@ApiParam(value = "order placed for purchasing the pet" ) Order body) @ApiParam(value = "order placed for purchasing the pet" ) Order body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Order>(HttpStatus.OK); return new ResponseEntity<Order>(HttpStatus.OK);
@ -78,6 +79,7 @@ public class StoreApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<Order> getOrderById( public ResponseEntity<Order> getOrderById(
@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId @ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -96,6 +98,7 @@ public class StoreApi {
method = RequestMethod.DELETE) method = RequestMethod.DELETE)
public ResponseEntity<Void> deleteOrder( public ResponseEntity<Void> deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId @ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!

View File

@ -30,7 +30,7 @@ import static org.springframework.http.MediaType.*;
@Controller @Controller
@RequestMapping(value = "/user", produces = {APPLICATION_JSON_VALUE}) @RequestMapping(value = "/user", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/user", description = "the user API") @Api(value = "/user", description = "the user API")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class UserApi { public class UserApi {
@ -43,7 +43,8 @@ public class UserApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> createUser( public ResponseEntity<Void> createUser(
@ApiParam(value = "Created user object" ) User body) @ApiParam(value = "Created user object" ) User body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -60,7 +61,8 @@ public class UserApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> createUsersWithArrayInput( public ResponseEntity<Void> createUsersWithArrayInput(
@ApiParam(value = "List of user object" ) List<User> body) @ApiParam(value = "List of user object" ) List<User> body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -77,7 +79,8 @@ public class UserApi {
method = RequestMethod.POST) method = RequestMethod.POST)
public ResponseEntity<Void> createUsersWithListInput( public ResponseEntity<Void> createUsersWithListInput(
@ApiParam(value = "List of user object" ) List<User> body) @ApiParam(value = "List of user object" ) List<User> body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -95,9 +98,11 @@ public class UserApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<String> loginUser(@ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username public ResponseEntity<String> loginUser(@ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username
, ,
@ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password @ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -131,7 +136,8 @@ public class UserApi {
method = RequestMethod.GET) method = RequestMethod.GET)
public ResponseEntity<User> getUserByName( public ResponseEntity<User> getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true ) @PathVariable("username") String username
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
@ -150,10 +156,12 @@ public class UserApi {
method = RequestMethod.PUT) method = RequestMethod.PUT)
public ResponseEntity<Void> updateUser( public ResponseEntity<Void> updateUser(
@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username @ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username
, ,
@ApiParam(value = "Updated user object" ) User body) @ApiParam(value = "Updated user object" ) User body
)
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!
return new ResponseEntity<Void>(HttpStatus.OK); return new ResponseEntity<Void>(HttpStatus.OK);
@ -171,6 +179,7 @@ public class UserApi {
method = RequestMethod.DELETE) method = RequestMethod.DELETE)
public ResponseEntity<Void> deleteUser( public ResponseEntity<Void> deleteUser(
@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username @ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username
) )
throws NotFoundException { throws NotFoundException {
// do some magic! // do some magic!

View File

@ -18,7 +18,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2 //Loads the spring beans required by the framework @EnableSwagger2 //Loads the spring beans required by the framework
@PropertySource("classpath:swagger.properties") @PropertySource("classpath:swagger.properties")
@Import(SwaggerUiConfiguration.class) @Import(SwaggerUiConfiguration.class)
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class SwaggerConfig { public class SwaggerConfig {
@Bean @Bean
ApiInfo apiInfo() { ApiInfo apiInfo() {

View File

@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter { public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };

View File

@ -2,7 +2,7 @@ package io.swagger.configuration;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override @Override

View File

@ -3,7 +3,7 @@ package io.swagger.configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class WebMvcConfiguration extends WebMvcConfigurationSupport { public class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Override @Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {

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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+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.SpringMVCServerCodegen", date = "2015-08-23T14:20:14.172-07:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2015-09-30T16:27:59.075+08:00")
public class User { public class User {
private Long id = null; private Long id = null;