Fix bean validation for Collection and add unit test (#14736)

* Fix bean validation for Collection + uni test

* Fix

* Adapt examples

* Fix comments

* Merge master

* Remove Bean validation for Maps

* Remove @Valid from jakarta

* Fix example

* Fix comments

* Fix springboot-3 example
This commit is contained in:
Dennis Melzer
2023-02-25 15:06:31 +01:00
committed by GitHub
parent 3aa7ec6a39
commit 92b96635bd
80 changed files with 477 additions and 263 deletions

View File

@@ -98,7 +98,7 @@ public class ArrayTestDto {
return this;
}
public ArrayTestDto addArrayArrayOfModelItem(List<ReadOnlyFirstDto> arrayArrayOfModelItem) {
public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = new ArrayList<>();
}

View File

@@ -32,7 +32,7 @@ public class FileSchemaTestClassDto {
@JsonProperty("files")
@Valid
private List<FileDto> files = null;
private List<@Valid FileDto> files = null;
public FileSchemaTestClassDto file(FileDto file) {
this.file = file;
@@ -53,7 +53,7 @@ public class FileSchemaTestClassDto {
this.file = file;
}
public FileSchemaTestClassDto files(List<FileDto> files) {
public FileSchemaTestClassDto files(List<@Valid FileDto> files) {
this.files = files;
return this;
}
@@ -72,11 +72,11 @@ public class FileSchemaTestClassDto {
*/
@Valid
@ApiModelProperty(value = "")
public List<FileDto> getFiles() {
public List<@Valid FileDto> getFiles() {
return files;
}
public void setFiles(List<FileDto> files) {
public void setFiles(List<@Valid FileDto> files) {
this.files = files;
}

View File

@@ -47,7 +47,7 @@ public class PetDto {
@JsonProperty("tags")
@Valid
private List<TagDto> tags = null;
private List<@Valid TagDto> tags = null;
/**
* pet status in the store
@@ -171,7 +171,7 @@ public class PetDto {
this.photoUrls = photoUrls;
}
public PetDto tags(List<TagDto> tags) {
public PetDto tags(List<@Valid TagDto> tags) {
this.tags = tags;
return this;
}
@@ -190,11 +190,11 @@ public class PetDto {
*/
@Valid
@ApiModelProperty(value = "")
public List<TagDto> getTags() {
public List<@Valid TagDto> getTags() {
return tags;
}
public void setTags(List<TagDto> tags) {
public void setTags(List<@Valid TagDto> tags) {
this.tags = tags;
}