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:
@@ -5,6 +5,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* A category for a pet
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
*/
|
||||
@@ -38,7 +39,7 @@ public class Pet {
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
|
||||
private List<Tag> tags = null;
|
||||
private List<@Valid Tag> tags = null;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -153,7 +154,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;
|
||||
}
|
||||
@@ -170,11 +171,11 @@ public class Pet {
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* A tag for a pet
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Set;
|
||||
import javax.validation.*;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user