Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ import javax.validation.Valid;
@Controller
{{#operations}}
public class {{classname}}Controller implements {{classname}} {
{{^isDelegate}}
private final ObjectMapper objectMapper;

public {{classname}}Controller(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}

{{/isDelegate}}
{{#isDelegate}}
private final {{classname}}Delegate delegate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}} {{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}},
allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}} {{#defaultValue}},
defaultValue="{{{defaultValue}}}"{{/defaultValue}})
@PathVariable("{{paramName}}") {{{dataType}}} {{paramName}}{{/isPathParam}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.swagger.api;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class ApiException extends Exception{
private int code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class ApiOriginFilter implements javax.servlet.Filter {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.xml.bind.annotation.XmlTransient;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@javax.xml.bind.annotation.XmlRootElement
public class ApiResponseMessage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.swagger.api;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class NotFoundException extends ApiException {
private int code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Api(value = "pet", description = "the pet API")
public interface PetApi {
Expand Down Expand Up @@ -60,7 +61,8 @@ default CompletableFuture<ResponseEntity<Void>> addPet(@ApiParam(value = "Pet ob
@RequestMapping(value = "/pet/{petId}",
produces = { "application/xml", "application/json" },
method = RequestMethod.DELETE)
default CompletableFuture<ResponseEntity<Void>> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
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(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
}
Expand Down Expand Up @@ -112,7 +114,8 @@ default CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags( @NotNull@Ap
@RequestMapping(value = "/pet/{petId}",
produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
default CompletableFuture<ResponseEntity<Pet>> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
default CompletableFuture<ResponseEntity<Pet>> getPetById(@ApiParam(value = "ID of pet to return",required=true )
@PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Pet>(HttpStatus.OK));
}
Expand Down Expand Up @@ -150,7 +153,8 @@ default CompletableFuture<ResponseEntity<Void>> updatePet(@ApiParam(value = "Pet
produces = { "application/xml", "application/json" },
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.POST)
default CompletableFuture<ResponseEntity<Void>> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
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(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
}
Expand All @@ -168,7 +172,8 @@ default CompletableFuture<ResponseEntity<Void>> updatePetWithForm(@ApiParam(valu
produces = { "application/json" },
consumes = { "multipart/form-data" },
method = RequestMethod.POST)
default CompletableFuture<ResponseEntity<ModelApiResponse>> uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
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") @Valid @RequestPart("file") MultipartFile file, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<ModelApiResponse>(HttpStatus.OK));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Controller
public class PetApiController implements PetApi {
Expand All @@ -13,5 +14,4 @@ public class PetApiController implements PetApi {
public PetApiController(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Api(value = "store", description = "the store API")
public interface StoreApi {
Expand All @@ -34,10 +35,11 @@ public interface StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found") })
@RequestMapping(value = "/store/order/{order_id}",
@RequestMapping(value = "/store/order/{orderId}",
produces = { "application/xml", "application/json" },
method = RequestMethod.DELETE)
default CompletableFuture<ResponseEntity<Void>> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
default CompletableFuture<ResponseEntity<Void>> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true )
@PathVariable("orderId") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
}
Expand All @@ -62,10 +64,11 @@ default CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory( @R
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found") })
@RequestMapping(value = "/store/order/{order_id}",
@RequestMapping(value = "/store/order/{orderId}",
produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
default CompletableFuture<ResponseEntity<Order>> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
default CompletableFuture<ResponseEntity<Order>> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true )
@PathVariable("orderId") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Controller
public class StoreApiController implements StoreApi {
Expand All @@ -13,5 +14,4 @@ public class StoreApiController implements StoreApi {
public StoreApiController(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Api(value = "user", description = "the user API")
public interface UserApi {
Expand Down Expand Up @@ -73,7 +74,8 @@ default CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(@ApiPar
@RequestMapping(value = "/user/{username}",
produces = { "application/xml", "application/json" },
method = RequestMethod.DELETE)
default CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
default CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true )
@PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
}
Expand All @@ -87,7 +89,8 @@ default CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "Th
@RequestMapping(value = "/user/{username}",
produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
default CompletableFuture<ResponseEntity<User>> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
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(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<User>(HttpStatus.OK));
}
Expand Down Expand Up @@ -125,7 +128,8 @@ default CompletableFuture<ResponseEntity<Void>> logoutUser( @RequestHeader(value
@RequestMapping(value = "/user/{username}",
produces = { "application/xml", "application/json" },
method = RequestMethod.PUT)
default CompletableFuture<ResponseEntity<Void>> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception {
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(value = "Accept", required = false) String accept) throws Exception {
// do some magic!
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import javax.validation.constraints.*;
import javax.validation.Valid;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Controller
public class UserApiController implements UserApi {
Expand All @@ -13,5 +14,4 @@ public class UserApiController implements UserApi {
public UserApiController(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Configuration
public class SwaggerDocumentationConfig {

ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Swagger Petstore")
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
.description("This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.")
.license("Apache-2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

@Configuration
@ComponentScan(basePackages = "io.swagger.api")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import javax.validation.constraints.*;

/**
* Category
* A category for a pet
*/
@ApiModel(description = "A category for a pet")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class Category {
@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import javax.validation.constraints.*;

/**
* ModelApiResponse
* Describes the result of uploading an image resource
*/
@ApiModel(description = "Describes the result of uploading an image resource")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class ModelApiResponse {
@JsonProperty("code")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
import javax.validation.constraints.*;

/**
* Order
* An order for a pets from the pet store
*/
@ApiModel(description = "An order for a pets from the pet store")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class Order {
@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import javax.validation.constraints.*;

/**
* Pet
* A pet for sale in the pet store
*/
@ApiModel(description = "A pet for sale in the pet store")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class Pet {
@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import javax.validation.constraints.*;

/**
* Tag
* A tag for a pet
*/
@ApiModel(description = "A tag for a pet")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class Tag {
@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import javax.validation.constraints.*;

/**
* User
* A User who is purchasing from the pet store
*/
@ApiModel(description = "A User who is purchasing from the pet store")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:23:27.059+03:00")

public class User {
@JsonProperty("id")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.swagger.api;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:22:52.503+03:00")

public class ApiException extends Exception{
private int code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:22:52.503+03:00")

public class ApiOriginFilter implements javax.servlet.Filter {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.xml.bind.annotation.XmlTransient;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:22:52.503+03:00")

@javax.xml.bind.annotation.XmlRootElement
public class ApiResponseMessage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.swagger.api;

@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2017-10-19T13:22:52.503+03:00")

public class NotFoundException extends ApiException {
private int code;
Expand Down
Loading