forked from loafle/openapi-generator-original
[4947][java]: adds support for validation of primitives in arrays (#17165)
* [4947][java]: adds support for validation of primitives in arrays
* [4947][java]: prevents generation '@Valid' for Object
* [4947][java]: test against different codegens and stick to primitive
* [4947][java]: code review
* [4947][java]: enhance getBeanValidation
* [4947][java]: adds email
* [4947][java]: removes unnecessary override
* [4947][java]: adds postProcessResponseWithProperty
* [4947][java]: adds missing import {{javaxPackage}}.validation.Valid
* [4947][java]: adds missing useBeanValidation
* [4947][java]: fix use rootJavaEEPackage for helidon
This commit is contained in:
@@ -80,7 +80,7 @@ public interface UserApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<Void> createUsersWithArrayInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
|
||||
) {
|
||||
return getDelegate().createUsersWithArrayInput(user);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public interface UserApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<Void> createUsersWithListInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
|
||||
) {
|
||||
return getDelegate().createUsersWithListInput(user);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface UserApiDelegate {
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithArrayInput
|
||||
*/
|
||||
default ResponseEntity<Void> createUsersWithArrayInput(List<User> user) {
|
||||
default ResponseEntity<Void> createUsersWithArrayInput(List<@Valid User> user) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public interface UserApiDelegate {
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithListInput
|
||||
*/
|
||||
default ResponseEntity<Void> createUsersWithListInput(List<User> user) {
|
||||
default ResponseEntity<Void> createUsersWithListInput(List<@Valid User> user) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ArrayTest {
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
|
||||
@Valid
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<@Valid ReadOnlyFirst>> arrayArrayOfModel;
|
||||
|
||||
public ArrayTest arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
@@ -91,7 +91,7 @@ public class ArrayTest {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
public ArrayTest arrayArrayOfModel(List<List<@Valid ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
return this;
|
||||
}
|
||||
@@ -111,11 +111,11 @@ public class ArrayTest {
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("array_array_of_model")
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
public List<List<@Valid ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
public void setArrayArrayOfModel(List<List<@Valid ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user