FasterXML / FasterXML/jackson-dataformats-text

Infer non-string types from property values.

Đang mở
#20 7 bình luận 2 reaction 0 người được giao Xem trên GitHub
Properties
Ngôn ngữ chính
Java
Star
455
Fork
164
Merge trung bình
6 ngày 10 giờ
Pull request đã merge (30 ngày)
2

Mô tả

It would be great if there was a way to specify a non-string property value when mapping to the generic `ObjectNode` type. For example:

```
Properties props = new Properties();

props.setProperty("booleanExample", "true");
props.setProperty("integerExample", "4");
props.setProperty("stringExample", "some string");

ObjectNode root = new JavaPropsMapper().readValue(props, ObjectNode.class);

System.out.println(new ObjectMapper().writeValueAsString(root));
```

This code outputs

`{"integerExample":"4","booleanExample":"true","stringExample":"some string"}`

But it would be great if there was some configuration or way to escape property values such that the output inferred integer or boolean types from the values themselves:

`{"integerExample":4,"booleanExample":true,"stringExample":"some string"}`

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.