mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 10:02:46 +00:00
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:
@@ -96,7 +96,7 @@ public class ArrayTest {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class FileSchemaTestClass {
|
||||
|
||||
@JsonProperty("files")
|
||||
@Valid
|
||||
private List<File> files = null;
|
||||
private List<@Valid File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(File file) {
|
||||
this.file = file;
|
||||
@@ -51,7 +51,7 @@ public class FileSchemaTestClass {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<File> files) {
|
||||
public FileSchemaTestClass files(List<@Valid File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
@@ -70,11 +70,11 @@ public class FileSchemaTestClass {
|
||||
*/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public List<File> getFiles() {
|
||||
public List<@Valid File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<File> files) {
|
||||
public void setFiles(List<@Valid File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Pet {
|
||||
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
private List<Tag> tags = null;
|
||||
private List<@Valid Tag> tags = null;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -165,7 +165,7 @@ public class Pet {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
public Pet tags(List<Tag> tags) {
|
||||
public Pet tags(List<@Valid Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
@@ -184,11 +184,11 @@ public class Pet {
|
||||
*/
|
||||
@Valid
|
||||
@ApiModelProperty(value = "")
|
||||
public List<Tag> getTags() {
|
||||
public List<@Valid Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<Tag> tags) {
|
||||
public void setTags(List<@Valid Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user