Description
If you add a single typed string "object" to pet definition in petstore like below.
The generator does not create any @SiZe annotation and no @pattern.
But when you paste content of nickName instead of $ref, it does create the annotations.
This has to be a bug or am I missing something?
I need to reuse this nickName type in various places and would like to have the min/max constraints defined only once. How do I achieve this?
Note if you create type: object with only one string property then it generates correctly. But it is not appealing to have an objet just for hosting one string.
Swagger-codegen version
2.3.1
Addition to petstore.yml
nick:
$ref: "#/definitions/nickName"
nickName:
type: string
minLength: 1
maxLength: 3
pattern: "^[A-Z]+$"
Command line used for generation
swagger-codegen generate -i ./petstore.yml -l spring -o ./petstore