mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 02:02:45 +00:00
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "fake", description = "the fake API")
|
||||
public interface FakeApi {
|
||||
@@ -32,7 +33,7 @@ public interface FakeApi {
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
default CompletableFuture<ResponseEntity<Client>> testClientModel(@ApiParam(value = "client model" ,required=true ) @RequestBody Client body) {
|
||||
default CompletableFuture<ResponseEntity<Client>> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Client>(HttpStatus.OK));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.swagger.api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class FakeApiController implements FakeApi {
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "pet", description = "the pet API")
|
||||
public interface PetApi {
|
||||
@@ -36,7 +37,7 @@ public interface PetApi {
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@@ -130,7 +131,7 @@ public interface PetApi {
|
||||
produces = { "application/xml", "application/json" },
|
||||
consumes = { "application/json", "application/xml" },
|
||||
method = RequestMethod.PUT)
|
||||
default CompletableFuture<ResponseEntity<Void>> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.swagger.api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class PetApiController implements PetApi {
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "store", description = "the store API")
|
||||
public interface StoreApi {
|
||||
@@ -74,7 +75,7 @@ public interface StoreApi {
|
||||
@RequestMapping(value = "/store/order",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Order>> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) {
|
||||
default CompletableFuture<ResponseEntity<Order>> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Order>(HttpStatus.OK));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.swagger.api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class StoreApiController implements StoreApi {
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "user", description = "the user API")
|
||||
public interface UserApi {
|
||||
@@ -29,7 +30,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@@ -42,7 +43,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/createWithArray",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@@ -55,7 +56,7 @@ public interface UserApi {
|
||||
@RequestMapping(value = "/user/createWithList",
|
||||
produces = { "application/xml", "application/json" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List<User> body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
@@ -125,7 +126,7 @@ public interface UserApi {
|
||||
@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 ) @RequestBody User body) {
|
||||
default CompletableFuture<ResponseEntity<Void>> updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) {
|
||||
// do some magic!
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<Void>(HttpStatus.OK));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.swagger.api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class UserApiController implements UserApi {
|
||||
|
||||
@@ -26,6 +26,9 @@ public class AdditionalPropertiesClass {
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||
if (this.mapProperty == null) {
|
||||
this.mapProperty = new HashMap<String, String>();
|
||||
}
|
||||
this.mapProperty.put(key, mapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
@@ -49,6 +52,9 @@ public class AdditionalPropertiesClass {
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||
if (this.mapOfMapProperty == null) {
|
||||
this.mapOfMapProperty = new HashMap<String, Map<String, String>>();
|
||||
}
|
||||
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
}
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
if (this.arrayArrayNumber == null) {
|
||||
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
}
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public class ArrayOfNumberOnly {
|
||||
}
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
if (this.arrayNumber == null) {
|
||||
this.arrayNumber = new ArrayList<BigDecimal>();
|
||||
}
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ public class ArrayTest {
|
||||
}
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
if (this.arrayOfString == null) {
|
||||
this.arrayOfString = new ArrayList<String>();
|
||||
}
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
}
|
||||
@@ -52,6 +55,9 @@ public class ArrayTest {
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
if (this.arrayArrayOfInteger == null) {
|
||||
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
}
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
}
|
||||
@@ -75,6 +81,9 @@ public class ArrayTest {
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
}
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,9 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
if (this.arrayEnum == null) {
|
||||
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
}
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@ public class MapTest {
|
||||
}
|
||||
|
||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||
if (this.mapMapOfString == null) {
|
||||
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||
}
|
||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||
return this;
|
||||
}
|
||||
@@ -81,6 +84,9 @@ public class MapTest {
|
||||
}
|
||||
|
||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||
if (this.mapOfEnumString == null) {
|
||||
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
}
|
||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
}
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||
if (this.map == null) {
|
||||
this.map = new HashMap<String, Animal>();
|
||||
}
|
||||
this.map.put(key, mapItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -152,6 +152,9 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<Tag>();
|
||||
}
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user