Reputation: 1369
I have following model in my contract descriptor
BaseGroup:
type: object
properties:
name:
type: string
pattern: '^\p{Alnum}+$'
maxLength: 50
which generates
public class BaseGroupDto {
@JsonProperty("name")
private String name;
/**
* Get name
* @return name
*/
@ApiModelProperty(required = true, value = "")
@NotNull
@Pattern(regexp="^\\p{Alnum}+$")
@Size(max=50)
public String getName() {
return name;
}
...
}
is it possible somehow configure openapi generator to use @Max
instead of @Size
for length check?
I use this maven plugin to generate DTOs
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
</plugin>
Upvotes: 0
Views: 1198