Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Size annotation is ignored on String fields #79

Open
rbellmf opened this issue May 27, 2015 · 1 comment
Open

@Size annotation is ignored on String fields #79

rbellmf opened this issue May 27, 2015 · 1 comment
Milestone

Comments

@rbellmf
Copy link

rbellmf commented May 27, 2015

A bean field like:
@SiZe(min = 1, max = 36)
@NotNull
private String subject

Will show up in the swagger json as:
"subject" : {
"type" : "string"
}

It should be used to set maxLength and minLength per the @SiZe documentation(http://docs.oracle.com/javaee/7/api/javax/validation/constraints/Size.html):
"subject" : {
"type" : "string",
"minLength" : "1",
"maxLength" : "36"
}

@conorroche
Copy link

note minLength and maxLength are swagger spec 2.0 features and are not part of the 1.2 spec which is why this doclet doesnt support these yet, it will in future when swagger spec 2.0 is supported, there is a separate task for that

@conorroche conorroche modified the milestones: 1.1 release, 2.0 Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants