mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
[Java][Spring] Undo "Add examples defined in the spec to Spring MVC server generator " (#5599)
* remove unused pom.xml in go pestore * remove example support in JavaSprin (undo changes)
This commit is contained in:
parent
ec7b80abab
commit
9b68f02f83
@ -16,9 +16,6 @@ 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;
|
||||
{{^useSpringCloudClient}}
|
||||
import java.io.IOException;
|
||||
{{/useSpringCloudClient}}
|
||||
|
||||
import java.util.List;
|
||||
{{#async}}
|
||||
@ -43,31 +40,20 @@ public interface {{classname}} {
|
||||
}{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
|
||||
@ApiResponses(value = { {{#responses}}
|
||||
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
|
||||
{{#implicitHeaders}}
|
||||
@ApiImplicitParams({
|
||||
{{#implicitHeaders}}@ApiImplicitParams({
|
||||
{{#headerParams}}{{>implicitHeader}}{{/headerParams}}
|
||||
})
|
||||
{{/implicitHeaders}}
|
||||
}){{/implicitHeaders}}
|
||||
@RequestMapping(value = "{{{path}}}",{{#singleContentTypes}}
|
||||
produces = "{{{vendorExtensions.x-accepts}}}",
|
||||
consumes = "{{{vendorExtensions.x-contentType}}}",{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}
|
||||
produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}}
|
||||
consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}}
|
||||
method = RequestMethod.{{httpMethod}})
|
||||
{{#useSpringCloudClient}}
|
||||
{{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} {
|
||||
// do some magic!
|
||||
return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}};
|
||||
}{{/jdk8}}
|
||||
|
||||
{{/useSpringCloudClient}}
|
||||
{{^useSpringCloudClient}}
|
||||
{{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}} @RequestHeader("Accept") String accept){{#examples}}{{#-first}} throws IOException{{/-first}}{{/examples}}{{^jdk8}};{{/jdk8}}{{#jdk8}} {
|
||||
// do some magic!
|
||||
return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}};
|
||||
}{{/jdk8}}
|
||||
|
||||
{{/useSpringCloudClient}}
|
||||
{{/operation}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
@ -21,12 +21,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
{{#async}}
|
||||
import java.util.concurrent.Callable;
|
||||
{{/async}}
|
||||
{{/jdk8-no-delegate}}
|
||||
{{^useSpringCloudClient}}
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
{{/useSpringCloudClient}}
|
||||
{{/async}}{{/jdk8-no-delegate}}
|
||||
{{#useBeanValidation}}
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
@ -35,72 +30,27 @@ import javax.validation.Valid;
|
||||
@Controller
|
||||
{{#operations}}
|
||||
public class {{classname}}Controller implements {{classname}} {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public {{classname}}Controller(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
{{#isDelegate}}
|
||||
private final {{classname}}Delegate delegate;
|
||||
|
||||
@org.springframework.beans.factory.annotation.Autowired
|
||||
public {{classname}}Controller({{classname}}Delegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
}{{/isDelegate}}
|
||||
|
||||
{{/isDelegate}}
|
||||
{{^jdk8-no-delegate}}
|
||||
{{#operation}}
|
||||
public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},
|
||||
{{/allParams}}@RequestHeader("Accept") String accept){{#examples}}{{#-first}} throws IOException{{/-first}}{{/examples}} {
|
||||
// do some magic!
|
||||
{{#useSpringCloudClient}}
|
||||
{{^isDelegate}}
|
||||
{{^async}}
|
||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
||||
{{/async}}
|
||||
{{#async}}
|
||||
{{^jdk8-no-delegate}}{{#operation}}
|
||||
public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
|
||||
{{/hasMore}}{{/allParams}}) {
|
||||
// do some magic!{{^isDelegate}}{{^async}}
|
||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);{{/async}}{{#async}}
|
||||
return new Callable<ResponseEntity<{{>returnTypes}}>>() {
|
||||
@Override
|
||||
public ResponseEntity<{{>returnTypes}}> call() throws Exception {
|
||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
||||
}
|
||||
};
|
||||
{{/async}}
|
||||
{{/isDelegate}}
|
||||
{{#isDelegate}}
|
||||
return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{/isDelegate}}
|
||||
{{/useSpringCloudClient}}
|
||||
{{^useSpringCloudClient}}
|
||||
{{^isDelegate}}
|
||||
{{^async}}
|
||||
{{#examples}}
|
||||
|
||||
if (accept != null && accept.contains("{{{contentType}}}")) {
|
||||
return new ResponseEntity<{{>returnTypes}}>(objectMapper.readValue("{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{example}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{>exampleReturnTypes}}.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
{{/examples}}
|
||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
||||
{{/async}}
|
||||
{{#async}}
|
||||
return new Callable<ResponseEntity<{{>returnTypes}}>>() {
|
||||
@Override
|
||||
public ResponseEntity<{{>returnTypes}}> call() throws Exception {
|
||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
||||
}
|
||||
};
|
||||
{{/async}}
|
||||
{{/isDelegate}}
|
||||
{{#isDelegate}}
|
||||
return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{/isDelegate}}
|
||||
{{/useSpringCloudClient}}
|
||||
};{{/async}}{{/isDelegate}}{{#isDelegate}}
|
||||
return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/isDelegate}}
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
{{/jdk8-no-delegate}}
|
||||
{{/operation}}{{/jdk8-no-delegate}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
@ -1,75 +0,0 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>Gopetstore</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0.0</version>
|
||||
<name>Gopetstore</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>go-get-testify</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>go</executable>
|
||||
<arguments>
|
||||
<argument>get</argument>
|
||||
<argument>github.com/stretchr/testify/assert</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>go-get-sling</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>go</executable>
|
||||
<arguments>
|
||||
<argument>get</argument>
|
||||
<argument>github.com/dghubble/sling</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>go-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>go</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
<argument>-v</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -30,6 +30,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -45,6 +46,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -61,6 +63,7 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByStatus",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -77,6 +80,7 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByTags",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -91,6 +95,7 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -108,6 +113,7 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -123,6 +129,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/x-www-form-urlencoded",
|
||||
@ -138,6 +145,7 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||
produces = "application/json",
|
||||
consumes = "multipart/form-data",
|
||||
|
@ -25,6 +25,7 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{orderId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -37,6 +38,7 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -49,6 +51,7 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{orderId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -60,6 +63,7 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
|
@ -24,6 +24,7 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -34,6 +35,7 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -44,6 +46,7 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -55,6 +58,7 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -67,6 +71,7 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -78,6 +83,7 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
|
||||
@RequestMapping(value = "/user/login",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -88,6 +94,7 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
@ -99,6 +106,7 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
|
@ -31,7 +31,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -118,7 +118,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -139,6 +139,7 @@ public class Order {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public DateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -158,7 +159,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -178,7 +179,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -102,6 +102,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -122,7 +123,7 @@ public class Pet {
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -148,7 +149,7 @@ public class Pet {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -177,6 +178,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -196,7 +198,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -109,7 +109,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -169,7 +169,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -189,7 +189,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ 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.*;
|
||||
@ -31,11 +30,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -46,11 +46,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey);
|
||||
|
||||
|
||||
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@ -62,11 +63,12 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByStatus",
|
||||
produces = "application/json",
|
||||
consumes = "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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@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 = {
|
||||
@ -78,11 +80,12 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByTags",
|
||||
produces = "application/json",
|
||||
consumes = "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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);
|
||||
|
||||
|
||||
@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@ -92,11 +95,12 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -109,11 +113,12 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.PUT)
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@ -124,11 +129,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = "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, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@ -139,10 +145,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||
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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ 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.*;
|
||||
@ -26,11 +25,12 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{orderId}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@ -38,11 +38,12 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Map<String, Integer>> getInventory( @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Map<String, Integer>> getInventory();
|
||||
|
||||
|
||||
@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", })
|
||||
@ -50,21 +51,23 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{orderId}",
|
||||
produces = "application/json",
|
||||
consumes = "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("orderId") Long orderId, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body);
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ 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.*;
|
||||
@ -25,42 +24,46 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.DELETE)
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@ -68,42 +71,46 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
|
||||
@RequestMapping(value = "/user/login",
|
||||
produces = "application/json",
|
||||
consumes = "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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = "application/json",
|
||||
consumes = "application/json",
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Void> logoutUser( @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> logoutUser();
|
||||
|
||||
|
||||
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = "application/json",
|
||||
consumes = "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 ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -118,7 +118,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -139,6 +139,7 @@ public class Order {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public DateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -158,7 +159,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -178,7 +179,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -102,6 +102,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -122,7 +123,7 @@ public class Pet {
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -148,7 +149,7 @@ public class Pet {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -177,6 +178,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -196,7 +198,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -109,7 +109,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -169,7 +169,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -189,7 +189,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ 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 java.util.concurrent.CompletableFuture;
|
||||
@ -29,11 +28,12 @@ public interface FakeApi {
|
||||
@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) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
default CompletableFuture<ResponseEntity<Client>> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<Client>> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Client>(HttpStatus.OK));
|
||||
}
|
||||
@ -45,11 +45,12 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
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)
|
||||
default CompletableFuture<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("Accept") String accept) {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -59,11 +60,12 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
produces = { "*/*" },
|
||||
consumes = { "*/*" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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("Accept") String accept) {
|
||||
default CompletableFuture<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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ 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 java.util.concurrent.CompletableFuture;
|
||||
@ -33,11 +32,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -51,10 +51,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
default CompletableFuture<ResponseEntity<Void>> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -69,10 +70,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByStatus",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<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("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<List<Pet>>(HttpStatus.OK));
|
||||
}
|
||||
@ -87,10 +89,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/findByTags",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags, @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<List<Pet>>(HttpStatus.OK));
|
||||
}
|
||||
@ -103,10 +106,11 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<ResponseEntity<Pet>> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<Pet>> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Pet>(HttpStatus.OK));
|
||||
}
|
||||
@ -122,11 +126,12 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.PUT)
|
||||
default CompletableFuture<ResponseEntity<Void>> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -140,11 +145,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/x-www-form-urlencoded" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<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("Accept") String accept) {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -158,11 +164,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||
produces = { "application/json" },
|
||||
consumes = { "multipart/form-data" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<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("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<ModelApiResponse>(HttpStatus.OK));
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ 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 java.util.concurrent.CompletableFuture;
|
||||
@ -28,10 +27,11 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{order_id}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
default CompletableFuture<ResponseEntity<Void>> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -42,10 +42,11 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = { "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory( @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory() {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Map<String, Integer>>(HttpStatus.OK));
|
||||
}
|
||||
@ -56,10 +57,11 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order/{order_id}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<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("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<Order>> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
||||
}
|
||||
@ -69,10 +71,11 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||
|
||||
@RequestMapping(value = "/store/order",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Order>> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<Order>> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ 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 java.util.concurrent.CompletableFuture;
|
||||
@ -27,10 +26,11 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -39,10 +39,11 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -51,10 +52,11 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -64,10 +66,11 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.DELETE)
|
||||
default CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -78,10 +81,11 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<ResponseEntity<User>> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<ResponseEntity<User>> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<User>(HttpStatus.OK));
|
||||
}
|
||||
@ -91,10 +95,11 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
|
||||
@RequestMapping(value = "/user/login",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<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("Accept") String accept) throws IOException {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<String>(HttpStatus.OK));
|
||||
}
|
||||
@ -103,10 +108,11 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
default CompletableFuture<ResponseEntity<Void>> logoutUser( @RequestHeader("Accept") String accept) {
|
||||
default CompletableFuture<ResponseEntity<Void>> logoutUser() {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@ -116,10 +122,11 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.PUT)
|
||||
default CompletableFuture<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("Accept") String accept) {
|
||||
default CompletableFuture<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) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class AdditionalPropertiesClass {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@ -70,6 +70,7 @@ public class AdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Animal {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class ArrayOfNumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ArrayTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@ -73,6 +73,7 @@ public class ArrayTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@ -101,6 +102,7 @@ public class ArrayTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@ -102,7 +102,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@ -142,7 +142,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class Cat extends Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ClassModel {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Client {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class Dog extends Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class EnumArrays {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class EnumArrays {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
@ -153,7 +153,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
@ -194,6 +194,7 @@ public class EnumTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ public class FormatTest {
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Min(10) @Max(100)
|
||||
@Valid
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
@ -90,8 +90,8 @@ public class FormatTest {
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Min(20) @Max(200)
|
||||
@Valid
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
@ -133,8 +133,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
|
||||
@Valid
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
@ -155,8 +156,8 @@ public class FormatTest {
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||
@Valid
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
@ -177,8 +178,8 @@ public class FormatTest {
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||
@Valid
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
@ -197,8 +198,8 @@ public class FormatTest {
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Pattern(regexp="/[a-z]/i")
|
||||
@Valid
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
@ -219,7 +220,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
@ -239,7 +240,7 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
@ -261,6 +262,7 @@ public class FormatTest {
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
@ -281,6 +283,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -301,6 +304,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -320,8 +324,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Size(min=10,max=64)
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class HasOnlyReadOnly {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class HasOnlyReadOnly {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ public class MapTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
@ -101,7 +102,7 @@ public class MapTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -60,6 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -88,6 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Model200Response {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Model200Response {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -53,7 +53,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -73,7 +73,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ModelReturn {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Name {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ public class NumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -138,6 +138,7 @@ public class Order {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -157,7 +158,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -177,7 +178,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -101,6 +101,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -121,7 +122,7 @@ public class Pet {
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -147,7 +148,7 @@ public class Pet {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -176,6 +177,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -195,7 +197,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class ReadOnlyFirst {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class ReadOnlyFirst {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class SpecialModelName {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -148,7 +148,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -168,7 +168,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -188,7 +188,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ 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.*;
|
||||
@ -27,11 +26,12 @@ public interface FakeApi {
|
||||
@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) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = {
|
||||
@ -40,21 +40,23 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
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, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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("Accept") String accept);
|
||||
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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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);
|
||||
|
||||
}
|
||||
|
@ -18,27 +18,17 @@ 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 ) @Valid @RequestBody Client body,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
|
||||
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
@ -55,8 +45,7 @@ public class FakeApiController implements FakeApi {
|
||||
@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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
@ -68,8 +57,7 @@ public class FakeApiController implements FakeApi {
|
||||
@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("Accept") String accept) {
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ 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.*;
|
||||
@ -31,11 +30,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
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 ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -46,10 +46,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
|
||||
@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,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey);
|
||||
|
||||
|
||||
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@ -61,10 +62,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@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 = {
|
||||
@ -76,10 +78,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);
|
||||
|
||||
|
||||
@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@ -89,10 +92,11 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -105,11 +109,12 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
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 ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@ -120,11 +125,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
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, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@ -135,10 +141,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||
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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -17,104 +17,57 @@ 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 ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
|
||||
public ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// 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,
|
||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
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) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||
// 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 ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) {
|
||||
// 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,7 +13,6 @@ 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.*;
|
||||
@ -26,10 +25,11 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@ -37,10 +37,11 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = { "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Map<String, Integer>> getInventory( @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Map<String, Integer>> getInventory();
|
||||
|
||||
|
||||
@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", })
|
||||
@ -48,19 +49,21 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||
|
||||
@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 ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body);
|
||||
|
||||
}
|
||||
|
@ -16,64 +16,32 @@ 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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
|
||||
public ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Map<String, Integer>> getInventory(@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Map<String, Integer>> getInventory() {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
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) {
|
||||
// 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 ) @Valid @RequestBody Order body,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||
// 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,7 +13,6 @@ 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.*;
|
||||
@ -25,38 +24,42 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@ -64,38 +67,42 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Void> logoutUser( @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> logoutUser();
|
||||
|
||||
|
||||
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@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 ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -16,84 +16,53 @@ 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 ) @Valid @RequestBody User body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
|
||||
public ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
@NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) {
|
||||
// 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(@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> logoutUser() {
|
||||
// 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 ) @Valid @RequestBody User body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class AdditionalPropertiesClass {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@ -70,6 +70,7 @@ public class AdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Animal {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public class ArrayOfNumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ArrayTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@ -73,6 +73,7 @@ public class ArrayTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@ -101,6 +102,7 @@ public class ArrayTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@ -102,7 +102,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@ -142,7 +142,7 @@ public class Capitalization {
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class Cat extends Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class Category {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ClassModel {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Client {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class Dog extends Animal {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class EnumArrays {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class EnumArrays {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
@ -153,7 +153,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class EnumTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
@ -194,6 +194,7 @@ public class EnumTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ public class FormatTest {
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Min(10) @Max(100)
|
||||
@Valid
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
@ -90,8 +90,8 @@ public class FormatTest {
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Min(20) @Max(200)
|
||||
@Valid
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
@ -133,8 +133,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
|
||||
@Valid
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
@ -155,8 +156,8 @@ public class FormatTest {
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||
@Valid
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
@ -177,8 +178,8 @@ public class FormatTest {
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||
@Valid
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
@ -197,8 +198,8 @@ public class FormatTest {
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Pattern(regexp="/[a-z]/i")
|
||||
@Valid
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
@ -219,7 +220,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
@ -239,7 +240,7 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
@ -261,6 +262,7 @@ public class FormatTest {
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
@ -281,6 +283,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public DateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -301,6 +304,7 @@ public class FormatTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -320,8 +324,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Size(min=10,max=64)
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class HasOnlyReadOnly {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class HasOnlyReadOnly {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ public class MapTest {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
@ -101,7 +102,7 @@ public class MapTest {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -60,6 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public DateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -88,6 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class Model200Response {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class Model200Response {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -53,7 +53,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -73,7 +73,7 @@ public class ModelApiResponse {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ModelReturn {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Name {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ public class NumberOnly {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -138,6 +138,7 @@ public class Order {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public DateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -157,7 +158,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -177,7 +178,7 @@ public class Order {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -101,6 +101,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -121,7 +122,7 @@ public class Pet {
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -147,7 +148,7 @@ public class Pet {
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -176,6 +177,7 @@ public class Pet {
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -195,7 +197,7 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class ReadOnlyFirst {
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class ReadOnlyFirst {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class SpecialModelName {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class Tag {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -148,7 +148,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -168,7 +168,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -188,7 +188,7 @@ public class User {
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ 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.*;
|
||||
@ -27,11 +26,12 @@ public interface FakeApi {
|
||||
@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) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = {
|
||||
@ -40,21 +40,23 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
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, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/fake",
|
||||
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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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("Accept") String accept);
|
||||
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 = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@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);
|
||||
|
||||
}
|
||||
|
@ -18,27 +18,17 @@ 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 ) @Valid @RequestBody Client body,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
|
||||
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
@ -55,8 +45,7 @@ public class FakeApiController implements FakeApi {
|
||||
@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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
@ -68,8 +57,7 @@ public class FakeApiController implements FakeApi {
|
||||
@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("Accept") String accept) {
|
||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ 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.*;
|
||||
@ -31,11 +30,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
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 ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -46,10 +46,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
|
||||
@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,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey);
|
||||
|
||||
|
||||
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
|
||||
@ -61,10 +62,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@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 = {
|
||||
@ -76,10 +78,11 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);
|
||||
|
||||
|
||||
@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
|
||||
@ -89,10 +92,11 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
|
||||
@ -105,11 +109,12 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet",
|
||||
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 ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
|
||||
@ -120,11 +125,12 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
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, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||
@ -135,10 +141,11 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
|
||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||
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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -17,104 +17,57 @@ 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 ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
|
||||
public ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// 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,
|
||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
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) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||
// 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 ) @Valid @RequestBody Pet body,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
public ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) {
|
||||
// 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,7 +13,6 @@ 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.*;
|
||||
@ -26,10 +25,11 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
|
||||
@ -37,10 +37,11 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||
|
||||
@RequestMapping(value = "/store/inventory",
|
||||
produces = { "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Map<String, Integer>> getInventory( @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Map<String, Integer>> getInventory();
|
||||
|
||||
|
||||
@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", })
|
||||
@ -48,19 +49,21 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId);
|
||||
|
||||
|
||||
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||
|
||||
@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 ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body);
|
||||
|
||||
}
|
||||
|
@ -16,64 +16,32 @@ 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,
|
||||
@RequestHeader("Accept") String accept) {
|
||||
|
||||
public ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId) {
|
||||
// do some magic!
|
||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
public ResponseEntity<Map<String, Integer>> getInventory(@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Map<String, Integer>> getInventory() {
|
||||
// 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,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
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) {
|
||||
// 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 ) @Valid @RequestBody Order body,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||
// 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,7 +13,6 @@ 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.*;
|
||||
@ -25,38 +24,42 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
|
||||
|
||||
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
|
||||
@ -64,38 +67,42 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||
|
||||
@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, @RequestHeader("Accept") String accept) throws IOException;
|
||||
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);
|
||||
|
||||
|
||||
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||
|
||||
@RequestMapping(value = "/user/logout",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.GET)
|
||||
ResponseEntity<Void> logoutUser( @RequestHeader("Accept") String accept);
|
||||
ResponseEntity<Void> logoutUser();
|
||||
|
||||
|
||||
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||
|
||||
@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 ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept);
|
||||
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);
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user