-
Notifications
You must be signed in to change notification settings - Fork 138
"minimum": 0.0 is not set when @Min(0) is used #83
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
Comments
The problem is in this class:
I try to use config and annotation
|
@alaingiller Global setting is only default, per-property annotation will override it. Which Jackson version are you using? Jackson 2.6 did consider default primitive values as "empty", but due to user feedback this change was reverted so that all other versions (and both 2.5 and 2.7) only consider "empty" to apply to container types, |
I'm using jackson-jsonSchema 2.7.3 and also try with 2.7.4 and jackson-databind 2.6.6 |
@alaingiller Inclusion is not used for JSR-303 annotation at all. It is only checked when serializing values of POJOs. So for the inclusion settings to take effect here, specific Schema value class has to have inclusion settings that do that. JSON Schema value objects are nothing special from Jackson perspective (nor should they be): they are handled just like any other Java class, based on settings and annotations. At this point I do not know how to reproduce the problem. |
Very easy to reproduce:
and then: The generated JsonSchema will be correct for |
Correct in... ? |
Generated json-schema:
Correct in case property |
@alaingiller |
@ivan-osipov : So you say that you run my little exemple and you didn't get the same result as me? |
Consider the following:
when serialized to json schema, will output:
instead of:
everything works fine if we define any other number than 0.
By looking at the ValidationConstraintResolver/AnnotationConstraintResolver, why the minimumValue/maximumValue is always converted to double?
When the type is integer, shoudn't the minimum/maximum value stays to an integer format?
When I look at the following documentation:
http://spacetelescope.github.io/understanding-json-schema/reference/numeric.html
Under range, the integer format is preserved. Should I open different issues for this?
Thank you very much!
The text was updated successfully, but these errors were encountered: