forked from loafle/openapi-generator-original
[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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
{{^useSpringCloudClient}}
|
|
||||||
import java.io.IOException;
|
|
||||||
{{/useSpringCloudClient}}
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
{{#async}}
|
{{#async}}
|
||||||
@ -43,31 +40,20 @@ public interface {{classname}} {
|
|||||||
}{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
|
}{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} })
|
||||||
@ApiResponses(value = { {{#responses}}
|
@ApiResponses(value = { {{#responses}}
|
||||||
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
|
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
|
||||||
{{#implicitHeaders}}
|
{{#implicitHeaders}}@ApiImplicitParams({
|
||||||
@ApiImplicitParams({
|
|
||||||
{{#headerParams}}{{>implicitHeader}}{{/headerParams}}
|
{{#headerParams}}{{>implicitHeader}}{{/headerParams}}
|
||||||
})
|
}){{/implicitHeaders}}
|
||||||
{{/implicitHeaders}}
|
|
||||||
@RequestMapping(value = "{{{path}}}",{{#singleContentTypes}}
|
@RequestMapping(value = "{{{path}}}",{{#singleContentTypes}}
|
||||||
produces = "{{{vendorExtensions.x-accepts}}}",
|
produces = "{{{vendorExtensions.x-accepts}}}",
|
||||||
consumes = "{{{vendorExtensions.x-contentType}}}",{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}
|
consumes = "{{{vendorExtensions.x-contentType}}}",{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}
|
||||||
produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}}
|
produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}}
|
||||||
consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}}
|
consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}}
|
||||||
method = RequestMethod.{{httpMethod}})
|
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}} {
|
{{#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!
|
// do some magic!
|
||||||
return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}};
|
return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}};
|
||||||
}{{/jdk8}}
|
}{{/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}}
|
{{/operation}}
|
||||||
}
|
}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
|
@ -21,12 +21,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
{{#async}}
|
{{#async}}
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
{{/async}}
|
{{/async}}{{/jdk8-no-delegate}}
|
||||||
{{/jdk8-no-delegate}}
|
|
||||||
{{^useSpringCloudClient}}
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
{{/useSpringCloudClient}}
|
|
||||||
{{#useBeanValidation}}
|
{{#useBeanValidation}}
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@ -35,72 +30,27 @@ import javax.validation.Valid;
|
|||||||
@Controller
|
@Controller
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
public class {{classname}}Controller implements {{classname}} {
|
public class {{classname}}Controller implements {{classname}} {
|
||||||
private final ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
public {{classname}}Controller(ObjectMapper objectMapper) {
|
|
||||||
this.objectMapper = objectMapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
{{#isDelegate}}
|
{{#isDelegate}}
|
||||||
private final {{classname}}Delegate delegate;
|
private final {{classname}}Delegate delegate;
|
||||||
|
|
||||||
@org.springframework.beans.factory.annotation.Autowired
|
@org.springframework.beans.factory.annotation.Autowired
|
||||||
public {{classname}}Controller({{classname}}Delegate delegate) {
|
public {{classname}}Controller({{classname}}Delegate delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
}
|
}{{/isDelegate}}
|
||||||
|
|
||||||
{{/isDelegate}}
|
{{^jdk8-no-delegate}}{{#operation}}
|
||||||
{{^jdk8-no-delegate}}
|
public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},
|
||||||
{{#operation}}
|
{{/hasMore}}{{/allParams}}) {
|
||||||
public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},
|
// do some magic!{{^isDelegate}}{{^async}}
|
||||||
{{/allParams}}@RequestHeader("Accept") String accept){{#examples}}{{#-first}} throws IOException{{/-first}}{{/examples}} {
|
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);{{/async}}{{#async}}
|
||||||
// do some magic!
|
|
||||||
{{#useSpringCloudClient}}
|
|
||||||
{{^isDelegate}}
|
|
||||||
{{^async}}
|
|
||||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
|
||||||
{{/async}}
|
|
||||||
{{#async}}
|
|
||||||
return new Callable<ResponseEntity<{{>returnTypes}}>>() {
|
return new Callable<ResponseEntity<{{>returnTypes}}>>() {
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<{{>returnTypes}}> call() throws Exception {
|
public ResponseEntity<{{>returnTypes}}> call() throws Exception {
|
||||||
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
return new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
};
|
};{{/async}}{{/isDelegate}}{{#isDelegate}}
|
||||||
{{/async}}
|
return delegate.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/isDelegate}}
|
||||||
{{/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);
|
|
||||||
}
|
}
|
||||||
|
{{/operation}}{{/jdk8-no-delegate}}
|
||||||
{{/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}}
|
|
||||||
}
|
|
||||||
|
|
||||||
{{/operation}}
|
|
||||||
{{/jdk8-no-delegate}}
|
|
||||||
}
|
}
|
||||||
{{/operations}}
|
{{/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", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -45,6 +46,7 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -61,6 +63,7 @@ public interface PetApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByStatus",
|
@RequestMapping(value = "/pet/findByStatus",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -77,6 +80,7 @@ public interface PetApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByTags",
|
@RequestMapping(value = "/pet/findByTags",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -91,6 +95,7 @@ public interface PetApi {
|
|||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -108,6 +113,7 @@ public interface PetApi {
|
|||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -123,6 +129,7 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/x-www-form-urlencoded",
|
consumes = "application/x-www-form-urlencoded",
|
||||||
@ -138,6 +145,7 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "multipart/form-data",
|
consumes = "multipart/form-data",
|
||||||
|
@ -25,6 +25,7 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{orderId}",
|
@RequestMapping(value = "/store/order/{orderId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -37,6 +38,7 @@ public interface StoreApi {
|
|||||||
}, tags={ "store", })
|
}, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/inventory",
|
@RequestMapping(value = "/store/inventory",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -49,6 +51,7 @@ public interface StoreApi {
|
|||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{orderId}",
|
@RequestMapping(value = "/store/order/{orderId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -60,6 +63,7 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order",
|
@RequestMapping(value = "/store/order",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "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", })
|
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user",
|
@RequestMapping(value = "/user",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithArray",
|
@RequestMapping(value = "/user/createWithArray",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithList",
|
@RequestMapping(value = "/user/createWithList",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -55,6 +58,7 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -67,6 +71,7 @@ public interface UserApi {
|
|||||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -78,6 +83,7 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/login",
|
@RequestMapping(value = "/user/login",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "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", })
|
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/logout",
|
@RequestMapping(value = "/user/logout",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
@ -99,6 +106,7 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
|
@ -31,7 +31,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getPetId() {
|
public Long getPetId() {
|
||||||
return petId;
|
return petId;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getQuantity() {
|
public Integer getQuantity() {
|
||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
@ -139,6 +139,7 @@ public class Order {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public DateTime getShipDate() {
|
public DateTime getShipDate() {
|
||||||
return shipDate;
|
return shipDate;
|
||||||
}
|
}
|
||||||
@ -158,7 +159,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Order Status")
|
@ApiModelProperty(value = "Order Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -178,7 +179,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getComplete() {
|
public Boolean getComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -102,6 +102,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Category getCategory() {
|
public Category getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
@ -122,7 +123,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -148,7 +149,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getPhotoUrls() {
|
public List<String> getPhotoUrls() {
|
||||||
return photoUrls;
|
return photoUrls;
|
||||||
}
|
}
|
||||||
@ -177,6 +178,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<Tag> getTags() {
|
public List<Tag> getTags() {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@ -196,7 +198,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
@ApiModelProperty(value = "pet status in the store")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
return firstName;
|
return firstName;
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getLastName() {
|
public String getLastName() {
|
||||||
return lastName;
|
return lastName;
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getEmail() {
|
public String getEmail() {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return phone;
|
return phone;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "User Status")
|
@ApiModelProperty(value = "User Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getUserStatus() {
|
public Integer getUserStatus() {
|
||||||
return userStatus;
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -31,11 +30,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||||
@ -46,11 +46,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByStatus",
|
@RequestMapping(value = "/pet/findByStatus",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByTags",
|
@RequestMapping(value = "/pet/findByTags",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.PUT)
|
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 = {
|
@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", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/x-www-form-urlencoded",
|
consumes = "application/x-www-form-urlencoded",
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||||
@ -139,10 +145,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "multipart/form-data",
|
consumes = "multipart/form-data",
|
||||||
method = RequestMethod.POST)
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -26,11 +25,12 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{orderId}",
|
@RequestMapping(value = "/store/order/{orderId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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", })
|
}, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/inventory",
|
@RequestMapping(value = "/store/inventory",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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", })
|
@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 = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{orderId}",
|
@RequestMapping(value = "/store/order/{orderId}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order",
|
@RequestMapping(value = "/store/order",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.POST)
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
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", })
|
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user",
|
@RequestMapping(value = "/user",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithArray",
|
@RequestMapping(value = "/user/createWithArray",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithList",
|
@RequestMapping(value = "/user/createWithList",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.DELETE)
|
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", })
|
@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 = 200, message = "successful operation", response = User.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/login",
|
@RequestMapping(value = "/user/login",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/logout",
|
@RequestMapping(value = "/user/logout",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = "application/json",
|
produces = "application/json",
|
||||||
consumes = "application/json",
|
consumes = "application/json",
|
||||||
method = RequestMethod.PUT)
|
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 = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getPetId() {
|
public Long getPetId() {
|
||||||
return petId;
|
return petId;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getQuantity() {
|
public Integer getQuantity() {
|
||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
@ -139,6 +139,7 @@ public class Order {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public DateTime getShipDate() {
|
public DateTime getShipDate() {
|
||||||
return shipDate;
|
return shipDate;
|
||||||
}
|
}
|
||||||
@ -158,7 +159,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Order Status")
|
@ApiModelProperty(value = "Order Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -178,7 +179,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getComplete() {
|
public Boolean getComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -102,6 +102,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Category getCategory() {
|
public Category getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
@ -122,7 +123,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -148,7 +149,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getPhotoUrls() {
|
public List<String> getPhotoUrls() {
|
||||||
return photoUrls;
|
return photoUrls;
|
||||||
}
|
}
|
||||||
@ -177,6 +178,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<Tag> getTags() {
|
public List<Tag> getTags() {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@ -196,7 +198,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
@ApiModelProperty(value = "pet status in the store")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
return firstName;
|
return firstName;
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getLastName() {
|
public String getLastName() {
|
||||||
return lastName;
|
return lastName;
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getEmail() {
|
public String getEmail() {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return phone;
|
return phone;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "User Status")
|
@ApiModelProperty(value = "User Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getUserStatus() {
|
public Integer getUserStatus() {
|
||||||
return userStatus;
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
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", })
|
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" },
|
consumes = { "application/json" },
|
||||||
method = RequestMethod.PATCH)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Client>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Client>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -45,11 +45,12 @@ public interface FakeApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -59,11 +60,12 @@ public interface FakeApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "*/*" },
|
produces = { "*/*" },
|
||||||
consumes = { "*/*" },
|
consumes = { "*/*" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class FakeApiController implements FakeApi {
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -33,11 +32,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -51,10 +51,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -69,10 +70,11 @@ public interface PetApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByStatus",
|
@RequestMapping(value = "/pet/findByStatus",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<List<Pet>>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<List<Pet>>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -87,10 +89,11 @@ public interface PetApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByTags",
|
@RequestMapping(value = "/pet/findByTags",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<List<Pet>>(HttpStatus.OK));
|
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 = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Pet>(HttpStatus.OK));
|
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 = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.PUT)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -140,11 +145,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/x-www-form-urlencoded" },
|
consumes = { "application/x-www-form-urlencoded" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -158,11 +164,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "multipart/form-data" },
|
consumes = { "multipart/form-data" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<ModelApiResponse>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<ModelApiResponse>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class PetApiController implements PetApi {
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -28,10 +27,11 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -42,10 +42,11 @@ public interface StoreApi {
|
|||||||
}, tags={ "store", })
|
}, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/inventory",
|
@RequestMapping(value = "/store/inventory",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Map<String, Integer>>(HttpStatus.OK));
|
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 = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -69,10 +71,11 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order",
|
@RequestMapping(value = "/store/order",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class StoreApiController implements StoreApi {
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
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", })
|
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user",
|
@RequestMapping(value = "/user",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithArray",
|
@RequestMapping(value = "/user/createWithArray",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithList",
|
@RequestMapping(value = "/user/createWithList",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -64,10 +66,11 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
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 = 200, message = "successful operation", response = User.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<User>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<User>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -91,10 +95,11 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/login",
|
@RequestMapping(value = "/user/login",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<String>(HttpStatus.OK));
|
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", })
|
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/logout",
|
@RequestMapping(value = "/user/logout",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
method = RequestMethod.GET)
|
||||||
default CompletableFuture<ResponseEntity<Void>> logoutUser( @RequestHeader("Accept") String accept) {
|
default CompletableFuture<ResponseEntity<Void>> logoutUser() {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
@ -116,10 +122,11 @@ public interface UserApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.PUT)
|
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!
|
// do some magic!
|
||||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class UserApiController implements UserApi {
|
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 = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Map<String, String> getMapProperty() {
|
public Map<String, String> getMapProperty() {
|
||||||
return mapProperty;
|
return mapProperty;
|
||||||
}
|
}
|
||||||
@ -70,6 +70,7 @@ public class AdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||||
return mapOfMapProperty;
|
return mapOfMapProperty;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class Animal {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getColor() {
|
public String getColor() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public class ArrayOfArrayOfNumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||||
return arrayArrayNumber;
|
return arrayArrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public class ArrayOfNumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<BigDecimal> getArrayNumber() {
|
public List<BigDecimal> getArrayNumber() {
|
||||||
return arrayNumber;
|
return arrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class ArrayTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getArrayOfString() {
|
public List<String> getArrayOfString() {
|
||||||
return arrayOfString;
|
return arrayOfString;
|
||||||
}
|
}
|
||||||
@ -73,6 +73,7 @@ public class ArrayTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<Long>> getArrayArrayOfInteger() {
|
public List<List<Long>> getArrayArrayOfInteger() {
|
||||||
return arrayArrayOfInteger;
|
return arrayArrayOfInteger;
|
||||||
}
|
}
|
||||||
@ -101,6 +102,7 @@ public class ArrayTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||||
return arrayArrayOfModel;
|
return arrayArrayOfModel;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getSmallCamel() {
|
public String getSmallCamel() {
|
||||||
return smallCamel;
|
return smallCamel;
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getCapitalCamel() {
|
public String getCapitalCamel() {
|
||||||
return capitalCamel;
|
return capitalCamel;
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getSmallSnake() {
|
public String getSmallSnake() {
|
||||||
return smallSnake;
|
return smallSnake;
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getCapitalSnake() {
|
public String getCapitalSnake() {
|
||||||
return capitalSnake;
|
return capitalSnake;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getScAETHFlowPoints() {
|
public String getScAETHFlowPoints() {
|
||||||
return scAETHFlowPoints;
|
return scAETHFlowPoints;
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Name of the pet ")
|
@ApiModelProperty(value = "Name of the pet ")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getATTNAME() {
|
public String getATTNAME() {
|
||||||
return ATT_NAME;
|
return ATT_NAME;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Cat extends Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getDeclawed() {
|
public Boolean getDeclawed() {
|
||||||
return declawed;
|
return declawed;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class ClassModel {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPropertyClass() {
|
public String getPropertyClass() {
|
||||||
return propertyClass;
|
return propertyClass;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class Client {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getClient() {
|
public String getClient() {
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Dog extends Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBreed() {
|
public String getBreed() {
|
||||||
return breed;
|
return breed;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public class EnumArrays {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public JustSymbolEnum getJustSymbol() {
|
public JustSymbolEnum getJustSymbol() {
|
||||||
return justSymbol;
|
return justSymbol;
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public class EnumArrays {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<ArrayEnumEnum> getArrayEnum() {
|
public List<ArrayEnumEnum> getArrayEnum() {
|
||||||
return arrayEnum;
|
return arrayEnum;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumStringEnum getEnumString() {
|
public EnumStringEnum getEnumString() {
|
||||||
return enumString;
|
return enumString;
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumIntegerEnum getEnumInteger() {
|
public EnumIntegerEnum getEnumInteger() {
|
||||||
return enumInteger;
|
return enumInteger;
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumNumberEnum getEnumNumber() {
|
public EnumNumberEnum getEnumNumber() {
|
||||||
return enumNumber;
|
return enumNumber;
|
||||||
}
|
}
|
||||||
@ -194,6 +194,7 @@ public class EnumTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public OuterEnum getOuterEnum() {
|
public OuterEnum getOuterEnum() {
|
||||||
return outerEnum;
|
return outerEnum;
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,8 @@ public class FormatTest {
|
|||||||
* @return integer
|
* @return integer
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Min(10) @Max(100)
|
@Min(10) @Max(100)
|
||||||
@Valid
|
|
||||||
public Integer getInteger() {
|
public Integer getInteger() {
|
||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
@ -90,8 +90,8 @@ public class FormatTest {
|
|||||||
* @return int32
|
* @return int32
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Min(20) @Max(200)
|
@Min(20) @Max(200)
|
||||||
@Valid
|
|
||||||
public Integer getInt32() {
|
public Integer getInt32() {
|
||||||
return int32;
|
return int32;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getInt64() {
|
public Long getInt64() {
|
||||||
return int64;
|
return int64;
|
||||||
}
|
}
|
||||||
@ -133,8 +133,9 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
|
||||||
@Valid
|
@Valid
|
||||||
|
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||||
public BigDecimal getNumber() {
|
public BigDecimal getNumber() {
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
@ -155,8 +156,8 @@ public class FormatTest {
|
|||||||
* @return _float
|
* @return _float
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||||
@Valid
|
|
||||||
public Float getFloat() {
|
public Float getFloat() {
|
||||||
return _float;
|
return _float;
|
||||||
}
|
}
|
||||||
@ -177,8 +178,8 @@ public class FormatTest {
|
|||||||
* @return _double
|
* @return _double
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||||
@Valid
|
|
||||||
public Double getDouble() {
|
public Double getDouble() {
|
||||||
return _double;
|
return _double;
|
||||||
}
|
}
|
||||||
@ -197,8 +198,8 @@ public class FormatTest {
|
|||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Pattern(regexp="/[a-z]/i")
|
@Pattern(regexp="/[a-z]/i")
|
||||||
@Valid
|
|
||||||
public String getString() {
|
public String getString() {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
@ -219,7 +220,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public byte[] getByte() {
|
public byte[] getByte() {
|
||||||
return _byte;
|
return _byte;
|
||||||
}
|
}
|
||||||
@ -239,7 +240,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public byte[] getBinary() {
|
public byte[] getBinary() {
|
||||||
return binary;
|
return binary;
|
||||||
}
|
}
|
||||||
@ -261,6 +262,7 @@ public class FormatTest {
|
|||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public LocalDate getDate() {
|
public LocalDate getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
@ -281,6 +283,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public OffsetDateTime getDateTime() {
|
public OffsetDateTime getDateTime() {
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
@ -301,6 +304,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public UUID getUuid() {
|
public UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
@ -320,8 +324,8 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Size(min=10,max=64)
|
@Size(min=10,max=64)
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class HasOnlyReadOnly {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class HasOnlyReadOnly {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ public class MapTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||||
return mapMapOfString;
|
return mapMapOfString;
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ public class MapTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||||
return mapOfEnumString;
|
return mapOfEnumString;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public UUID getUuid() {
|
public UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
@ -60,6 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public OffsetDateTime getDateTime() {
|
public OffsetDateTime getDateTime() {
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
@ -88,6 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Animal> getMap() {
|
public Map<String, Animal> getMap() {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class Model200Response {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getName() {
|
public Integer getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Model200Response {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPropertyClass() {
|
public String getPropertyClass() {
|
||||||
return propertyClass;
|
return propertyClass;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class ModelReturn {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getReturn() {
|
public Integer getReturn() {
|
||||||
return _return;
|
return _return;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class Name {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getName() {
|
public Integer getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getProperty() {
|
public String getProperty() {
|
||||||
return property;
|
return property;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ public class NumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public BigDecimal getJustNumber() {
|
public BigDecimal getJustNumber() {
|
||||||
return justNumber;
|
return justNumber;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getPetId() {
|
public Long getPetId() {
|
||||||
return petId;
|
return petId;
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getQuantity() {
|
public Integer getQuantity() {
|
||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
@ -138,6 +138,7 @@ public class Order {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public OffsetDateTime getShipDate() {
|
public OffsetDateTime getShipDate() {
|
||||||
return shipDate;
|
return shipDate;
|
||||||
}
|
}
|
||||||
@ -157,7 +158,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Order Status")
|
@ApiModelProperty(value = "Order Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -177,7 +178,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getComplete() {
|
public Boolean getComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -101,6 +101,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Category getCategory() {
|
public Category getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -147,7 +148,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getPhotoUrls() {
|
public List<String> getPhotoUrls() {
|
||||||
return photoUrls;
|
return photoUrls;
|
||||||
}
|
}
|
||||||
@ -176,6 +177,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<Tag> getTags() {
|
public List<Tag> getTags() {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@ -195,7 +197,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
@ApiModelProperty(value = "pet status in the store")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class ReadOnlyFirst {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class ReadOnlyFirst {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBaz() {
|
public String getBaz() {
|
||||||
return baz;
|
return baz;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class SpecialModelName {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getSpecialPropertyName() {
|
public Long getSpecialPropertyName() {
|
||||||
return specialPropertyName;
|
return specialPropertyName;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
return firstName;
|
return firstName;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getLastName() {
|
public String getLastName() {
|
||||||
return lastName;
|
return lastName;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getEmail() {
|
public String getEmail() {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return phone;
|
return phone;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "User Status")
|
@ApiModelProperty(value = "User Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getUserStatus() {
|
public Integer getUserStatus() {
|
||||||
return userStatus;
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
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", })
|
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" },
|
consumes = { "application/json" },
|
||||||
method = RequestMethod.PATCH)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "*/*" },
|
produces = { "*/*" },
|
||||||
consumes = { "*/*" },
|
consumes = { "*/*" },
|
||||||
method = RequestMethod.GET)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class FakeApiController implements FakeApi {
|
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!
|
// 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);
|
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="date", required=false) LocalDate date,
|
||||||
@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime,
|
@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="password", required=false) String password,
|
||||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback,
|
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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 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 (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, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
|
||||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble,
|
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -31,11 +30,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||||
@ -46,10 +46,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByStatus",
|
@RequestMapping(value = "/pet/findByStatus",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByTags",
|
@RequestMapping(value = "/pet/findByTags",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.PUT)
|
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 = {
|
@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", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/x-www-form-urlencoded" },
|
consumes = { "application/x-www-form-urlencoded" },
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||||
@ -135,10 +141,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "multipart/form-data" },
|
consumes = { "multipart/form-data" },
|
||||||
method = RequestMethod.POST)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class PetApiController implements PetApi {
|
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!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,
|
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,
|
||||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey,
|
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status,
|
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags,
|
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId,
|
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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,
|
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) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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,
|
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 name of the pet") @RequestPart(value="name", required=false) String name,
|
||||||
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status,
|
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,
|
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 = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,
|
||||||
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file,
|
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -26,10 +25,11 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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", })
|
}, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/inventory",
|
@RequestMapping(value = "/store/inventory",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@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 = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order",
|
@RequestMapping(value = "/store/order",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class StoreApiController implements StoreApi {
|
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!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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!
|
// 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);
|
return new ResponseEntity<Map<String, Integer>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId,
|
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<Order>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body,
|
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
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", })
|
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user",
|
@RequestMapping(value = "/user",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithArray",
|
@RequestMapping(value = "/user/createWithArray",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithList",
|
@RequestMapping(value = "/user/createWithList",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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", })
|
@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 = 200, message = "successful operation", response = User.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/login",
|
@RequestMapping(value = "/user/login",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/logout",
|
@RequestMapping(value = "/user/logout",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.PUT)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class UserApiController implements UserApi {
|
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!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body,
|
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username,
|
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username,
|
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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,
|
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,
|
@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 {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<String>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> logoutUser(@RequestHeader("Accept") String accept) {
|
public ResponseEntity<Void> logoutUser() {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,
|
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,
|
@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public class AdditionalPropertiesClass {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Map<String, String> getMapProperty() {
|
public Map<String, String> getMapProperty() {
|
||||||
return mapProperty;
|
return mapProperty;
|
||||||
}
|
}
|
||||||
@ -70,6 +70,7 @@ public class AdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||||
return mapOfMapProperty;
|
return mapOfMapProperty;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class Animal {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getColor() {
|
public String getColor() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public class ArrayOfArrayOfNumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||||
return arrayArrayNumber;
|
return arrayArrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public class ArrayOfNumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<BigDecimal> getArrayNumber() {
|
public List<BigDecimal> getArrayNumber() {
|
||||||
return arrayNumber;
|
return arrayNumber;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class ArrayTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getArrayOfString() {
|
public List<String> getArrayOfString() {
|
||||||
return arrayOfString;
|
return arrayOfString;
|
||||||
}
|
}
|
||||||
@ -73,6 +73,7 @@ public class ArrayTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<Long>> getArrayArrayOfInteger() {
|
public List<List<Long>> getArrayArrayOfInteger() {
|
||||||
return arrayArrayOfInteger;
|
return arrayArrayOfInteger;
|
||||||
}
|
}
|
||||||
@ -101,6 +102,7 @@ public class ArrayTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||||
return arrayArrayOfModel;
|
return arrayArrayOfModel;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getSmallCamel() {
|
public String getSmallCamel() {
|
||||||
return smallCamel;
|
return smallCamel;
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getCapitalCamel() {
|
public String getCapitalCamel() {
|
||||||
return capitalCamel;
|
return capitalCamel;
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getSmallSnake() {
|
public String getSmallSnake() {
|
||||||
return smallSnake;
|
return smallSnake;
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getCapitalSnake() {
|
public String getCapitalSnake() {
|
||||||
return capitalSnake;
|
return capitalSnake;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getScAETHFlowPoints() {
|
public String getScAETHFlowPoints() {
|
||||||
return scAETHFlowPoints;
|
return scAETHFlowPoints;
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ public class Capitalization {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Name of the pet ")
|
@ApiModelProperty(value = "Name of the pet ")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getATTNAME() {
|
public String getATTNAME() {
|
||||||
return ATT_NAME;
|
return ATT_NAME;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Cat extends Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getDeclawed() {
|
public Boolean getDeclawed() {
|
||||||
return declawed;
|
return declawed;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class Category {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class ClassModel {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPropertyClass() {
|
public String getPropertyClass() {
|
||||||
return propertyClass;
|
return propertyClass;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class Client {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getClient() {
|
public String getClient() {
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Dog extends Animal {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBreed() {
|
public String getBreed() {
|
||||||
return breed;
|
return breed;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public class EnumArrays {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public JustSymbolEnum getJustSymbol() {
|
public JustSymbolEnum getJustSymbol() {
|
||||||
return justSymbol;
|
return justSymbol;
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public class EnumArrays {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<ArrayEnumEnum> getArrayEnum() {
|
public List<ArrayEnumEnum> getArrayEnum() {
|
||||||
return arrayEnum;
|
return arrayEnum;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumStringEnum getEnumString() {
|
public EnumStringEnum getEnumString() {
|
||||||
return enumString;
|
return enumString;
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumIntegerEnum getEnumInteger() {
|
public EnumIntegerEnum getEnumInteger() {
|
||||||
return enumInteger;
|
return enumInteger;
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ public class EnumTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public EnumNumberEnum getEnumNumber() {
|
public EnumNumberEnum getEnumNumber() {
|
||||||
return enumNumber;
|
return enumNumber;
|
||||||
}
|
}
|
||||||
@ -194,6 +194,7 @@ public class EnumTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public OuterEnum getOuterEnum() {
|
public OuterEnum getOuterEnum() {
|
||||||
return outerEnum;
|
return outerEnum;
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,8 @@ public class FormatTest {
|
|||||||
* @return integer
|
* @return integer
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Min(10) @Max(100)
|
@Min(10) @Max(100)
|
||||||
@Valid
|
|
||||||
public Integer getInteger() {
|
public Integer getInteger() {
|
||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
@ -90,8 +90,8 @@ public class FormatTest {
|
|||||||
* @return int32
|
* @return int32
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Min(20) @Max(200)
|
@Min(20) @Max(200)
|
||||||
@Valid
|
|
||||||
public Integer getInt32() {
|
public Integer getInt32() {
|
||||||
return int32;
|
return int32;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getInt64() {
|
public Long getInt64() {
|
||||||
return int64;
|
return int64;
|
||||||
}
|
}
|
||||||
@ -133,8 +133,9 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
|
||||||
@Valid
|
@Valid
|
||||||
|
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||||
public BigDecimal getNumber() {
|
public BigDecimal getNumber() {
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
@ -155,8 +156,8 @@ public class FormatTest {
|
|||||||
* @return _float
|
* @return _float
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||||
@Valid
|
|
||||||
public Float getFloat() {
|
public Float getFloat() {
|
||||||
return _float;
|
return _float;
|
||||||
}
|
}
|
||||||
@ -177,8 +178,8 @@ public class FormatTest {
|
|||||||
* @return _double
|
* @return _double
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||||
@Valid
|
|
||||||
public Double getDouble() {
|
public Double getDouble() {
|
||||||
return _double;
|
return _double;
|
||||||
}
|
}
|
||||||
@ -197,8 +198,8 @@ public class FormatTest {
|
|||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Pattern(regexp="/[a-z]/i")
|
@Pattern(regexp="/[a-z]/i")
|
||||||
@Valid
|
|
||||||
public String getString() {
|
public String getString() {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
@ -219,7 +220,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public byte[] getByte() {
|
public byte[] getByte() {
|
||||||
return _byte;
|
return _byte;
|
||||||
}
|
}
|
||||||
@ -239,7 +240,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public byte[] getBinary() {
|
public byte[] getBinary() {
|
||||||
return binary;
|
return binary;
|
||||||
}
|
}
|
||||||
@ -261,6 +262,7 @@ public class FormatTest {
|
|||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public LocalDate getDate() {
|
public LocalDate getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
@ -281,6 +283,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public DateTime getDateTime() {
|
public DateTime getDateTime() {
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
@ -301,6 +304,7 @@ public class FormatTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public UUID getUuid() {
|
public UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
@ -320,8 +324,8 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Size(min=10,max=64)
|
@Size(min=10,max=64)
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class HasOnlyReadOnly {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class HasOnlyReadOnly {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ public class MapTest {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||||
return mapMapOfString;
|
return mapMapOfString;
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ public class MapTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||||
return mapOfEnumString;
|
return mapOfEnumString;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public UUID getUuid() {
|
public UUID getUuid() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
@ -60,6 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public DateTime getDateTime() {
|
public DateTime getDateTime() {
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
@ -88,6 +90,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Map<String, Animal> getMap() {
|
public Map<String, Animal> getMap() {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class Model200Response {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getName() {
|
public Integer getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class Model200Response {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPropertyClass() {
|
public String getPropertyClass() {
|
||||||
return propertyClass;
|
return propertyClass;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ public class ModelApiResponse {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class ModelReturn {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getReturn() {
|
public Integer getReturn() {
|
||||||
return _return;
|
return _return;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class Name {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getName() {
|
public Integer getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getProperty() {
|
public String getProperty() {
|
||||||
return property;
|
return property;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ public class Name {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ public class NumberOnly {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public BigDecimal getJustNumber() {
|
public BigDecimal getJustNumber() {
|
||||||
return justNumber;
|
return justNumber;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getPetId() {
|
public Long getPetId() {
|
||||||
return petId;
|
return petId;
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getQuantity() {
|
public Integer getQuantity() {
|
||||||
return quantity;
|
return quantity;
|
||||||
}
|
}
|
||||||
@ -138,6 +138,7 @@ public class Order {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public DateTime getShipDate() {
|
public DateTime getShipDate() {
|
||||||
return shipDate;
|
return shipDate;
|
||||||
}
|
}
|
||||||
@ -157,7 +158,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "Order Status")
|
@ApiModelProperty(value = "Order Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -177,7 +178,7 @@ public class Order {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Boolean getComplete() {
|
public Boolean getComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -101,6 +101,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public Category getCategory() {
|
public Category getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -147,7 +148,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
||||||
@Valid
|
|
||||||
public List<String> getPhotoUrls() {
|
public List<String> getPhotoUrls() {
|
||||||
return photoUrls;
|
return photoUrls;
|
||||||
}
|
}
|
||||||
@ -176,6 +177,7 @@ public class Pet {
|
|||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|
||||||
public List<Tag> getTags() {
|
public List<Tag> getTags() {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@ -195,7 +197,7 @@ public class Pet {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
@ApiModelProperty(value = "pet status in the store")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public StatusEnum getStatus() {
|
public StatusEnum getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class ReadOnlyFirst {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(readOnly = true, value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class ReadOnlyFirst {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getBaz() {
|
public String getBaz() {
|
||||||
return baz;
|
return baz;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class SpecialModelName {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getSpecialPropertyName() {
|
public Long getSpecialPropertyName() {
|
||||||
return specialPropertyName;
|
return specialPropertyName;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public class Tag {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
return firstName;
|
return firstName;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getLastName() {
|
public String getLastName() {
|
||||||
return lastName;
|
return lastName;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getEmail() {
|
public String getEmail() {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return phone;
|
return phone;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public class User {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "User Status")
|
@ApiModelProperty(value = "User Status")
|
||||||
|
|
||||||
@Valid
|
|
||||||
public Integer getUserStatus() {
|
public Integer getUserStatus() {
|
||||||
return userStatus;
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
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", })
|
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" },
|
consumes = { "application/json" },
|
||||||
method = RequestMethod.PATCH)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/fake",
|
@RequestMapping(value = "/fake",
|
||||||
produces = { "*/*" },
|
produces = { "*/*" },
|
||||||
consumes = { "*/*" },
|
consumes = { "*/*" },
|
||||||
method = RequestMethod.GET)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class FakeApiController implements FakeApi {
|
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!
|
// 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);
|
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="date", required=false) LocalDate date,
|
||||||
@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime,
|
@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="password", required=false) String password,
|
||||||
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback,
|
@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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 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 (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, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
|
||||||
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble,
|
@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -31,11 +30,12 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
|
||||||
@ -46,10 +46,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByStatus",
|
@RequestMapping(value = "/pet/findByStatus",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/findByTags",
|
@RequestMapping(value = "/pet/findByTags",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 200, message = "successful operation", response = Pet.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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 = {
|
@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 = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet",
|
@RequestMapping(value = "/pet",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/json", "application/xml" },
|
consumes = { "application/json", "application/xml" },
|
||||||
method = RequestMethod.PUT)
|
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 = {
|
@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", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}",
|
@RequestMapping(value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
consumes = { "application/x-www-form-urlencoded" },
|
consumes = { "application/x-www-form-urlencoded" },
|
||||||
method = RequestMethod.POST)
|
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 = {
|
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
|
||||||
@ -135,10 +141,11 @@ public interface PetApi {
|
|||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
@RequestMapping(value = "/pet/{petId}/uploadImage",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "multipart/form-data" },
|
consumes = { "multipart/form-data" },
|
||||||
method = RequestMethod.POST)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class PetApiController implements PetApi {
|
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!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,
|
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,
|
||||||
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey,
|
@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status,
|
public ResponseEntity<List<Pet>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List<String> status) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags,
|
public ResponseEntity<List<Pet>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<List<Pet>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId,
|
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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,
|
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) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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,
|
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 name of the pet") @RequestPart(value="name", required=false) String name,
|
||||||
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status,
|
@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) {
|
||||||
@RequestHeader("Accept") String accept) {
|
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
return new ResponseEntity<Void>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,
|
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 = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,
|
||||||
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file,
|
@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@ -26,10 +25,11 @@ public interface StoreApi {
|
|||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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 = {
|
@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", })
|
}, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/inventory",
|
@RequestMapping(value = "/store/inventory",
|
||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@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 = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order/{order_id}",
|
@RequestMapping(value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/store/order",
|
@RequestMapping(value = "/store/order",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import java.io.IOException;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class StoreApiController implements StoreApi {
|
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!
|
// do some magic!
|
||||||
return new ResponseEntity<Void>(HttpStatus.OK);
|
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!
|
// 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);
|
return new ResponseEntity<Map<String, Integer>>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId,
|
public ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
return new ResponseEntity<Order>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body,
|
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||||
@RequestHeader("Accept") String accept) throws IOException {
|
|
||||||
// do some magic!
|
// 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);
|
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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
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", })
|
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user",
|
@RequestMapping(value = "/user",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithArray",
|
@RequestMapping(value = "/user/createWithArray",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/createWithList",
|
@RequestMapping(value = "/user/createWithList",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.POST)
|
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", })
|
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.DELETE)
|
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", })
|
@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 = 200, message = "successful operation", response = User.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||||
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/login",
|
@RequestMapping(value = "/user/login",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
@ApiResponse(code = 200, message = "successful operation", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/logout",
|
@RequestMapping(value = "/user/logout",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.GET)
|
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", })
|
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", })
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
|
||||||
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
|
||||||
|
|
||||||
@RequestMapping(value = "/user/{username}",
|
@RequestMapping(value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" },
|
produces = { "application/xml", "application/json" },
|
||||||
method = RequestMethod.PUT)
|
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…
x
Reference in New Issue
Block a user