mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 10:56:10 +00:00
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -13,24 +13,24 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@ComponentScan(basePackages = "io.swagger")
|
||||
public class Swagger2SpringBoot implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... arg0) throws Exception {
|
||||
if (arg0.length > 0 && arg0[0].equals("exitcode")) {
|
||||
throw new ExitException();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void run(String... arg0) throws Exception {
|
||||
if (arg0.length > 0 && arg0[0].equals("exitcode")) {
|
||||
throw new ExitException();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplication(Swagger2SpringBoot.class).run(args);
|
||||
}
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplication(Swagger2SpringBoot.class).run(args);
|
||||
}
|
||||
|
||||
class ExitException extends RuntimeException implements ExitCodeGenerator {
|
||||
private static final long serialVersionUID = 1L;
|
||||
class ExitException extends RuntimeException implements ExitCodeGenerator {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public int getExitCode() {
|
||||
return 10;
|
||||
}
|
||||
@Override
|
||||
public int getExitCode() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package io.swagger.api;
|
||||
|
||||
|
||||
public class ApiException extends Exception{
|
||||
private int code;
|
||||
public ApiException (int code, String msg) {
|
||||
super(msg);
|
||||
this.code = code;
|
||||
}
|
||||
private int code;
|
||||
public ApiException (int code, String msg) {
|
||||
super(msg);
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,21 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
res.addHeader("Access-Control-Allow-Origin", "*");
|
||||
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
|
||||
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
res.addHeader("Access-Control-Allow-Origin", "*");
|
||||
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
|
||||
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,65 +5,65 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
@javax.xml.bind.annotation.XmlRootElement
|
||||
public class ApiResponseMessage {
|
||||
public static final int ERROR = 1;
|
||||
public static final int WARNING = 2;
|
||||
public static final int INFO = 3;
|
||||
public static final int OK = 4;
|
||||
public static final int TOO_BUSY = 5;
|
||||
public static final int ERROR = 1;
|
||||
public static final int WARNING = 2;
|
||||
public static final int INFO = 3;
|
||||
public static final int OK = 4;
|
||||
public static final int TOO_BUSY = 5;
|
||||
|
||||
int code;
|
||||
String type;
|
||||
String message;
|
||||
|
||||
public ApiResponseMessage(){}
|
||||
|
||||
public ApiResponseMessage(int code, String message){
|
||||
this.code = code;
|
||||
switch(code){
|
||||
case ERROR:
|
||||
setType("error");
|
||||
break;
|
||||
case WARNING:
|
||||
setType("warning");
|
||||
break;
|
||||
case INFO:
|
||||
setType("info");
|
||||
break;
|
||||
case OK:
|
||||
setType("ok");
|
||||
break;
|
||||
case TOO_BUSY:
|
||||
setType("too busy");
|
||||
break;
|
||||
default:
|
||||
setType("unknown");
|
||||
break;
|
||||
}
|
||||
this.message = message;
|
||||
}
|
||||
int code;
|
||||
String type;
|
||||
String message;
|
||||
|
||||
@XmlTransient
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public ApiResponseMessage(){}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
public ApiResponseMessage(int code, String message){
|
||||
this.code = code;
|
||||
switch(code){
|
||||
case ERROR:
|
||||
setType("error");
|
||||
break;
|
||||
case WARNING:
|
||||
setType("warning");
|
||||
break;
|
||||
case INFO:
|
||||
setType("info");
|
||||
break;
|
||||
case OK:
|
||||
setType("ok");
|
||||
break;
|
||||
case TOO_BUSY:
|
||||
setType("too busy");
|
||||
break;
|
||||
default:
|
||||
setType("unknown");
|
||||
break;
|
||||
}
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@XmlTransient
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import io.swagger.model.Client;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import io.swagger.model.OuterComposite;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -15,13 +16,59 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "fake", description = "the fake API")
|
||||
public interface FakeApi {
|
||||
|
||||
@ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) })
|
||||
@ApiImplicitParams({
|
||||
|
||||
})
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) })
|
||||
@ApiImplicitParams({
|
||||
|
||||
})
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) })
|
||||
@ApiImplicitParams({
|
||||
|
||||
})
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output string", response = String.class) })
|
||||
@ApiImplicitParams({
|
||||
|
||||
})
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@@ -32,7 +79,7 @@ public interface FakeApi {
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body);
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = {
|
||||
@@ -48,7 +95,7 @@ public interface FakeApi {
|
||||
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback);
|
||||
ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", })
|
||||
@@ -62,6 +109,6 @@ public interface FakeApi {
|
||||
produces = { "*/*" },
|
||||
consumes = { "*/*" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble);
|
||||
ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import io.swagger.model.Client;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import io.swagger.model.OuterComposite;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@@ -18,16 +19,71 @@ import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class FakeApiController implements FakeApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public FakeApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body) {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Boolean>(objectMapper.readValue("{ }", Boolean.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Boolean>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<OuterComposite>(objectMapper.readValue("{ \"my_string\" : { }, \"my_number\" : { }, \"my_boolean\" : { }}", OuterComposite.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<OuterComposite>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<BigDecimal>(objectMapper.readValue("{ }", BigDecimal.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<BigDecimal>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<String>(objectMapper.readValue("{ }", String.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<String>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -42,19 +98,21 @@ public class FakeApiController implements FakeApi {
|
||||
@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,
|
||||
@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,
|
||||
@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,
|
||||
@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime,
|
||||
@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,
|
||||
@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,
|
||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) {
|
||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List<String> enumFormStringArray,
|
||||
@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,
|
||||
@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,
|
||||
@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) {
|
||||
@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,
|
||||
@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "fake_classname_test", description = "the fake_classname_test API")
|
||||
public interface FakeClassnameTestApi {
|
||||
@@ -29,6 +31,6 @@ public interface FakeClassnameTestApi {
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body);
|
||||
ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,16 +15,27 @@ import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class FakeClassnameTestApiController implements FakeClassnameTestApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public FakeClassnameTestApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body) {
|
||||
public ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package io.swagger.api;
|
||||
|
||||
|
||||
public class NotFoundException extends ApiException {
|
||||
private int code;
|
||||
public NotFoundException (int code, String msg) {
|
||||
super(code, msg);
|
||||
this.code = code;
|
||||
}
|
||||
private int code;
|
||||
public NotFoundException (int code, String msg) {
|
||||
super(code, msg);
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -14,9 +14,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "pet", description = "the pet API")
|
||||
public interface PetApi {
|
||||
@@ -36,7 +38,7 @@ public interface PetApi {
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body);
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@@ -53,7 +55,7 @@ public interface PetApi {
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId);
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@@ -71,7 +73,7 @@ public interface PetApi {
|
||||
@RequestMapping(value = "/pet/findByStatus",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<List<Pet>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status);
|
||||
ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@@ -89,7 +91,7 @@ public interface PetApi {
|
||||
@RequestMapping(value = "/pet/findByTags",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<List<Pet>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);
|
||||
ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@@ -105,7 +107,7 @@ public interface PetApi {
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId);
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@@ -125,7 +127,7 @@ public interface PetApi {
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.PUT)
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body);
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@@ -143,7 +145,7 @@ public interface PetApi {
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/x-www-form-urlencoded" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@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);
|
||||
ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@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, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@@ -161,6 +163,6 @@ public interface PetApi {
|
||||
produces = { "application/json" },
|
||||
consumes = { "multipart/form-data" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<ModelApiResponse> uploadFile(@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 = "file detail") @RequestPart("file") MultipartFile file);
|
||||
ResponseEntity<ModelApiResponse> uploadFile(@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 = "file detail") @RequestPart("file") MultipartFile file, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@@ -17,55 +17,103 @@ import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class PetApiController implements PetApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public PetApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) {
|
||||
public ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId) {
|
||||
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status) {
|
||||
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<List<Pet>>(objectMapper.readValue("<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status></Pet>", List.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<List<Pet>>(objectMapper.readValue("<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status></Pet>", List.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<Pet>(objectMapper.readValue("<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status></Pet>", Pet.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Pet>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) {
|
||||
public ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,
|
||||
@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,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<ModelApiResponse> uploadFile(@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 = "file detail") @RequestPart("file") MultipartFile file) {
|
||||
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "store", description = "the store API")
|
||||
public interface StoreApi {
|
||||
@@ -30,7 +32,7 @@ public interface StoreApi {
|
||||
@RequestMapping(value = "/store/order/{order_id}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId);
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@@ -44,7 +46,7 @@ public interface StoreApi {
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = { "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Map<String, Integer>> getInventory();
|
||||
ResponseEntity<Map<String, Integer>> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@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", })
|
||||
@@ -58,7 +60,7 @@ public interface StoreApi {
|
||||
@RequestMapping(value = "/store/order/{order_id}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId);
|
||||
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@@ -71,6 +73,6 @@ public interface StoreApi {
|
||||
@RequestMapping(value = "/store/order",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body);
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -16,31 +16,64 @@ import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class StoreApiController implements StoreApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public StoreApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) {
|
||||
public ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Map<String, Integer>> getInventory() {
|
||||
public ResponseEntity<Map<String, Integer>> getInventory(@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Map<String, Integer>>(objectMapper.readValue("{ \"key\" : 0}", Map.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Map<String, Integer>>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) {
|
||||
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<Order>(objectMapper.readValue("<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete></Order>", Order.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Order>(objectMapper.readValue("{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}", Order.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Order>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) {
|
||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<Order>(objectMapper.readValue("<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete></Order>", Order.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Order>(objectMapper.readValue("{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}", Order.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Order>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "user", description = "the user API")
|
||||
public interface UserApi {
|
||||
@@ -29,7 +31,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body);
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@@ -41,7 +43,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body);
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@@ -53,7 +55,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body);
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@@ -66,7 +68,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username);
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@@ -80,7 +82,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username);
|
||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@@ -93,7 +95,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/login",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<String> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password);
|
||||
ResponseEntity<String> loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws IOException;
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@@ -105,7 +107,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Void> logoutUser();
|
||||
ResponseEntity<Void> logoutUser( @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
|
||||
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@@ -118,6 +120,6 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.PUT)
|
||||
ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body);
|
||||
ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,52 +16,84 @@ import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class UserApiController implements UserApi {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public UserApiController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
|
||||
public ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) {
|
||||
public ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body) {
|
||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body) {
|
||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) {
|
||||
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) {
|
||||
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<User>(objectMapper.readValue("<User> <id>123456789</id> <username>aeiou</username> <firstName>aeiou</firstName> <lastName>aeiou</lastName> <email>aeiou</email> <password>aeiou</password> <phone>aeiou</phone> <userStatus>123</userStatus></User>", User.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<User>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<String> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username,
|
||||
@NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) {
|
||||
public ResponseEntity<String> loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username,
|
||||
@NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return new ResponseEntity<String>(objectMapper.readValue("aeiou", String.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<String>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> logoutUser() {
|
||||
public ResponseEntity<Void> logoutUser(@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,
|
||||
@ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) {
|
||||
@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body,
|
||||
@RequestHeader(value = "Accept", required = false) String accept) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
*/
|
||||
@Controller
|
||||
public class HomeController {
|
||||
@RequestMapping(value = "/")
|
||||
public String index() {
|
||||
System.out.println("swagger-ui.html");
|
||||
return "redirect:swagger-ui.html";
|
||||
}
|
||||
@RequestMapping(value = "/")
|
||||
public String index() {
|
||||
System.out.println("swagger-ui.html");
|
||||
return "redirect:swagger-ui.html";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@@ -38,6 +40,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@@ -64,6 +68,9 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@@ -35,6 +37,8 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@@ -53,6 +57,8 @@ public class Animal {
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import java.util.Objects;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AnimalFarm
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@@ -35,6 +37,9 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@@ -35,6 +37,9 @@ public class ArrayOfNumberOnly {
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.ReadOnlyFirst;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@@ -41,6 +43,8 @@ public class ArrayTest {
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@@ -67,6 +71,9 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@@ -93,6 +100,9 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@@ -39,6 +41,8 @@ public class Capitalization {
|
||||
* @return smallCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@@ -57,6 +61,8 @@ public class Capitalization {
|
||||
* @return capitalCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@@ -75,6 +81,8 @@ public class Capitalization {
|
||||
* @return smallSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@@ -93,6 +101,8 @@ public class Capitalization {
|
||||
* @return capitalSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@@ -111,6 +121,8 @@ public class Capitalization {
|
||||
* @return scAETHFlowPoints
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@@ -129,6 +141,8 @@ public class Capitalization {
|
||||
* @return ATT_NAME
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@@ -25,6 +27,8 @@ public class Cat extends Animal {
|
||||
* @return declawed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@@ -27,6 +29,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -45,6 +49,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@@ -25,6 +27,8 @@ public class ClassModel {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@@ -24,6 +26,8 @@ public class Client {
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@@ -25,6 +27,8 @@ public class Dog extends Animal {
|
||||
* @return breed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
@@ -92,6 +94,8 @@ public class EnumArrays {
|
||||
* @return justSymbol
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@@ -118,6 +122,8 @@ public class EnumArrays {
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.OuterEnum;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
*/
|
||||
@@ -130,6 +132,8 @@ public class EnumTest {
|
||||
* @return enumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
@@ -148,6 +152,8 @@ public class EnumTest {
|
||||
* @return enumInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
@@ -166,6 +172,8 @@ public class EnumTest {
|
||||
* @return enumNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
@@ -184,6 +192,9 @@ public class EnumTest {
|
||||
* @return outerEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import java.math.BigDecimal;
|
||||
import java.util.UUID;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
*/
|
||||
@@ -66,7 +68,9 @@ public class FormatTest {
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(10) @Max(100) public Integer getInteger() {
|
||||
|
||||
@Min(10) @Max(100)
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
@@ -86,7 +90,9 @@ public class FormatTest {
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(20) @Max(200) public Integer getInt32() {
|
||||
|
||||
@Min(20) @Max(200)
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
@@ -104,6 +110,8 @@ public class FormatTest {
|
||||
* @return int64
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
@@ -125,7 +133,10 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
|
||||
|
||||
@Valid
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
@@ -145,7 +156,9 @@ public class FormatTest {
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
|
||||
|
||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
@@ -165,7 +178,9 @@ public class FormatTest {
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
|
||||
|
||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
@@ -183,7 +198,9 @@ public class FormatTest {
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Pattern(regexp="/[a-z]/i") public String getString() {
|
||||
|
||||
@Pattern(regexp="/[a-z]/i")
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
@@ -202,6 +219,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
@@ -220,6 +239,8 @@ public class FormatTest {
|
||||
* @return binary
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
@@ -239,6 +260,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
@@ -257,6 +281,9 @@ public class FormatTest {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@@ -275,6 +302,9 @@ public class FormatTest {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@@ -294,7 +324,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@Size(min=10,max=64) public String getPassword() {
|
||||
|
||||
@Size(min=10,max=64)
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
*/
|
||||
@@ -27,6 +29,8 @@ public class HasOnlyReadOnly {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@@ -45,6 +49,8 @@ public class HasOnlyReadOnly {
|
||||
* @return foo
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
*/
|
||||
@@ -70,6 +72,9 @@ public class MapTest {
|
||||
* @return mapMapOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
@@ -96,6 +101,8 @@ public class MapTest {
|
||||
* @return mapOfEnumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
@@ -36,6 +38,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@@ -54,6 +59,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@@ -80,6 +88,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return map
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
@@ -28,6 +30,8 @@ public class Model200Response {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -46,6 +50,8 @@ public class Model200Response {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
*/
|
||||
@@ -30,6 +32,8 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@@ -48,6 +52,8 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -66,6 +72,8 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
@@ -25,6 +27,8 @@ public class ModelReturn {
|
||||
* @return _return
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
@@ -35,6 +37,8 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -53,6 +57,8 @@ public class Name {
|
||||
* @return snakeCase
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
@@ -71,6 +77,8 @@ public class Name {
|
||||
* @return property
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
@@ -89,6 +97,8 @@ public class Name {
|
||||
* @return _123Number
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
*/
|
||||
@@ -25,6 +27,9 @@ public class NumberOnly {
|
||||
* @return justNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
@@ -74,6 +76,8 @@ public class Order {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -92,6 +96,8 @@ public class Order {
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@@ -110,6 +116,8 @@ public class Order {
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@@ -128,6 +136,9 @@ public class Order {
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@@ -146,6 +157,8 @@ public class Order {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@@ -164,6 +177,8 @@ public class Order {
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* OuterComposite
|
||||
*/
|
||||
|
||||
public class OuterComposite {
|
||||
@JsonProperty("my_number")
|
||||
private BigDecimal myNumber = null;
|
||||
|
||||
@JsonProperty("my_string")
|
||||
private String myString = null;
|
||||
|
||||
@JsonProperty("my_boolean")
|
||||
private Boolean myBoolean = null;
|
||||
|
||||
public OuterComposite myNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myNumber
|
||||
* @return myNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public BigDecimal getMyNumber() {
|
||||
return myNumber;
|
||||
}
|
||||
|
||||
public void setMyNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
}
|
||||
|
||||
public OuterComposite myString(String myString) {
|
||||
this.myString = myString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myString
|
||||
* @return myString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getMyString() {
|
||||
return myString;
|
||||
}
|
||||
|
||||
public void setMyString(String myString) {
|
||||
this.myString = myString;
|
||||
}
|
||||
|
||||
public OuterComposite myBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myBoolean
|
||||
* @return myBoolean
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Boolean getMyBoolean() {
|
||||
return myBoolean;
|
||||
}
|
||||
|
||||
public void setMyBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OuterComposite outerComposite = (OuterComposite) o;
|
||||
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
|
||||
Objects.equals(this.myString, outerComposite.myString) &&
|
||||
Objects.equals(this.myBoolean, outerComposite.myBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(myNumber, myString, myBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class OuterComposite {\n");
|
||||
|
||||
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
|
||||
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
|
||||
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Pet
|
||||
*/
|
||||
@@ -77,6 +79,8 @@ public class Pet {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -95,6 +99,9 @@ public class Pet {
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@@ -114,6 +121,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -138,6 +147,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@@ -164,6 +175,9 @@ public class Pet {
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@@ -182,6 +196,8 @@ public class Pet {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
*/
|
||||
@@ -27,6 +29,8 @@ public class ReadOnlyFirst {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@@ -45,6 +49,8 @@ public class ReadOnlyFirst {
|
||||
* @return baz
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
*/
|
||||
@@ -24,6 +26,8 @@ public class SpecialModelName {
|
||||
* @return specialPropertyName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
@@ -27,6 +29,8 @@ public class Tag {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -45,6 +49,8 @@ public class Tag {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* User
|
||||
*/
|
||||
@@ -45,6 +47,8 @@ public class User {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -63,6 +67,8 @@ public class User {
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@@ -81,6 +87,8 @@ public class User {
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@@ -99,6 +107,8 @@ public class User {
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@@ -117,6 +127,8 @@ public class User {
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@@ -135,6 +147,8 @@ public class User {
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@@ -153,6 +167,8 @@ public class User {
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@@ -171,6 +187,8 @@ public class User {
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user