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:
@@ -85,7 +85,7 @@ public interface UserApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<Void> createUsersWithArrayInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<UserDto> userDto
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto
|
||||
) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
@@ -115,7 +115,7 @@ public interface UserApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<Void> createUsersWithListInput(
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<UserDto> userDto
|
||||
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto
|
||||
) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ArrayTestDto {
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
|
||||
@Valid
|
||||
private List<List<ReadOnlyFirstDto>> arrayArrayOfModel;
|
||||
private List<List<@Valid ReadOnlyFirstDto>> arrayArrayOfModel;
|
||||
|
||||
public ArrayTestDto arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
@@ -93,7 +93,7 @@ public class ArrayTestDto {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
public ArrayTestDto arrayArrayOfModel(List<List<ReadOnlyFirstDto>> arrayArrayOfModel) {
|
||||
public ArrayTestDto arrayArrayOfModel(List<List<@Valid ReadOnlyFirstDto>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
return this;
|
||||
}
|
||||
@@ -113,11 +113,11 @@ public class ArrayTestDto {
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("array_array_of_model")
|
||||
public List<List<ReadOnlyFirstDto>> getArrayArrayOfModel() {
|
||||
public List<List<@Valid ReadOnlyFirstDto>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfModel(List<List<ReadOnlyFirstDto>> arrayArrayOfModel) {
|
||||
public void setArrayArrayOfModel(List<List<@Valid ReadOnlyFirstDto>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user