-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Infer non-string types from property values. #20
Comments
Yes, that would make sense. Not sure where and how this would work: I suspect that simple setting would not suffice since users tend to have their own preferences and nuances. So most likely need a handler of some kind. which would allow adding hooks for such conversion at low level: and could then tackle both properties and CSV format -- and perhaps even YAML, and maybe if we are lucky XML. |
Thanks, @cowtowncoder. I hadn't seen that issue. Perhaps this could be useful as a real-world use case for that feature once development starts. |
@skwirking yes, absolutely. |
Hi, a lot of time has passed - was just wondering - has anything possibly changed in regards to that issue, or is there any other way that JavaPropsMapper would read to JsonNode having integers / booleans instead of TextNodes? |
@mschielmann No, nothing has changed. If anyone had time & interest in adding configurable coercion/detection functionality, I'd be happy to review. |
Thank you for your answer @cowtowncoder, I of course understand. |
@mschielmann Yes, it's not necessarily the simplest thing ever. But changes would be quite self-contained; in Similar questions woudl be relevant for CSV backend as well, fwtw. |
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: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"}
The text was updated successfully, but these errors were encountered: