Skip to content
Merged
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 @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
{{/useBeanValidation}}

@Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.springframework.stereotype.Service;
public class {{classname}}ServiceImpl implements {{classname}} {
{{#operations}}
{{#operation}}
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParams}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// TODO: Implement...

{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}
{{#isBodyParam}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isBodyParam}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

@Path("/")
@Api(value = "/", description = "")
Expand All @@ -31,7 +32,7 @@ public interface FakeApi {
@ApiOperation(value = "To test \"client\" model", tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
public Client testClientModel(Client body);
public Client testClientModel(@Valid Client body);

@POST
@Path("/fake")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

@Path("/")
@Api(value = "/", description = "")
Expand All @@ -31,7 +32,7 @@ public interface PetApi {
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
public void addPet(Pet body);
public void addPet(@Valid Pet body);

@DELETE
@Path("/pet/{petId}")
Expand Down Expand Up @@ -78,7 +79,7 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(Pet body);
public void updatePet(@Valid Pet body);

@POST
@Path("/pet/{petId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

@Path("/")
@Api(value = "/", description = "")
Expand Down Expand Up @@ -57,6 +58,6 @@ public interface StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order") })
public Order placeOrder(Order body);
public Order placeOrder(@Valid Order body);
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

@Path("/")
@Api(value = "/", description = "")
Expand All @@ -29,23 +30,23 @@ public interface UserApi {
@ApiOperation(value = "Create user", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUser(User body);
public void createUser(@Valid User body);

@POST
@Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(List<User> body);
public void createUsersWithArrayInput(@Valid List<User> body);

@POST
@Path("/user/createWithList")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(List<User> body);
public void createUsersWithListInput(@Valid List<User> body);

@DELETE
@Path("/user/{username}")
Expand Down Expand Up @@ -90,6 +91,6 @@ public interface UserApi {
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found") })
public void updateUser(@PathParam("username") String username, User body);
public void updateUser(@Valid @PathParam("username") String username, User body);
}

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void setup() {
@Test
public void addPetTest() {
Pet body = null;
//api.addPet(body);
//api.addPet(body);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tab instead of 4-space is used. I'll file a PR to fix it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #5174


// TODO: test validations

Expand All @@ -99,7 +99,7 @@ public void addPetTest() {
public void deletePetTest() {
Long petId = null;
String apiKey = null;
//api.deletePet(petId, apiKey);
//api.deletePet(petId, apiKey);

// TODO: test validations

Expand Down Expand Up @@ -153,7 +153,7 @@ public void findPetsByTagsTest() {
@Test
public void getPetByIdTest() {
Long petId = null;
//Pet response = api.getPetById(petId);
//Pet response = api.getPetById(petId);
//assertNotNull(response);
// TODO: test validations

Expand All @@ -171,7 +171,7 @@ public void getPetByIdTest() {
@Test
public void updatePetTest() {
Pet body = null;
//api.updatePet(body);
//api.updatePet(body);

// TODO: test validations

Expand All @@ -191,7 +191,7 @@ public void updatePetWithFormTest() {
Long petId = null;
String name = null;
String status = null;
//api.updatePetWithForm(petId, name, status);
//api.updatePetWithForm(petId, name, status);

// TODO: test validations

Expand All @@ -211,7 +211,7 @@ public void uploadFileTest() {
Long petId = null;
String additionalMetadata = null;
org.apache.cxf.jaxrs.ext.multipart.Attachment file = null;
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//assertNotNull(response);
// TODO: test validations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void setup() {
@Test
public void deleteOrderTest() {
String orderId = null;
//api.deleteOrder(orderId);
//api.deleteOrder(orderId);

// TODO: test validations

Expand Down Expand Up @@ -114,7 +114,7 @@ public void getInventoryTest() {
@Test
public void getOrderByIdTest() {
Long orderId = null;
//Order response = api.getOrderById(orderId);
//Order response = api.getOrderById(orderId);
//assertNotNull(response);
// TODO: test validations

Expand All @@ -132,7 +132,7 @@ public void getOrderByIdTest() {
@Test
public void placeOrderTest() {
Order body = null;
//Order response = api.placeOrder(body);
//Order response = api.placeOrder(body);
//assertNotNull(response);
// TODO: test validations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void setup() {
@Test
public void createUserTest() {
User body = null;
//api.createUser(body);
//api.createUser(body);

// TODO: test validations

Expand All @@ -97,7 +97,7 @@ public void createUserTest() {
@Test
public void createUsersWithArrayInputTest() {
List<User> body = null;
//api.createUsersWithArrayInput(body);
//api.createUsersWithArrayInput(body);

// TODO: test validations

Expand All @@ -115,7 +115,7 @@ public void createUsersWithArrayInputTest() {
@Test
public void createUsersWithListInputTest() {
List<User> body = null;
//api.createUsersWithListInput(body);
//api.createUsersWithListInput(body);

// TODO: test validations

Expand All @@ -133,7 +133,7 @@ public void createUsersWithListInputTest() {
@Test
public void deleteUserTest() {
String username = null;
//api.deleteUser(username);
//api.deleteUser(username);

// TODO: test validations

Expand All @@ -151,7 +151,7 @@ public void deleteUserTest() {
@Test
public void getUserByNameTest() {
String username = null;
//User response = api.getUserByName(username);
//User response = api.getUserByName(username);
//assertNotNull(response);
// TODO: test validations

Expand All @@ -170,7 +170,7 @@ public void getUserByNameTest() {
public void loginUserTest() {
String username = null;
String password = null;
//String response = api.loginUser(username, password);
//String response = api.loginUser(username, password);
//assertNotNull(response);
// TODO: test validations

Expand All @@ -187,7 +187,7 @@ public void loginUserTest() {
*/
@Test
public void logoutUserTest() {
//api.logoutUser();
//api.logoutUser();

// TODO: test validations

Expand All @@ -206,7 +206,7 @@ public void logoutUserTest() {
public void updateUserTest() {
String username = null;
User body = null;
//api.updateUser(username, body);
//api.updateUser(username, body);

// TODO: test validations

Expand Down