FasterXML / FasterXML/jackson-module-jsonSchema

"minimum": 0.0 is not set when @Min(0) is used

Đang mở
#83 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
387
Fork
136
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Consider the following:

```
public class Person {
@Min(0)
private int id;
}
```

when serialized to json schema, will output:

```
{
"type" : "object",
"id" : "urn:jsonschema:xxx:Person",
"properties" : {
"id" : {
"type" : "integer"
}
}
```

instead of:

```
{
"type" : "object",
"id" : "urn:jsonschema:xxx:Person",
"properties" : {
"id" : {
"type" : "integer",
"minimum" : 0.0
}
}
```

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!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.