FasterXML / FasterXML/jackson-dataformats-text

Infer non-string types from property values.

Ouverte
#20 7 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Properties
Langage dominant
Java
Étoiles
455
Forks
164
Merge moyen
6 j 10 h
PR mergées (30 j)
2

Description

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"}`

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.