upickle
upickle copied to clipboard
Integers are not parsed correctly
read[Int]("1.1")
returns 1, instead of throwing an error
@lihaoyi Is this a bug or a feature? 😅
Haha good question. I don't actually know.
It seems the direction we're moving in is to be more forgiving on reads - e.g. https://github.com/com-lihaoyi/upickle/pull/385 allows us to read numeric strings as primitives as well - so it's not unreasonable that we would be forgiving to reading fractional integers as well.
Could go either way really
Something like the configuration flag ACCEPT_FLOAT_AS_INT
in Jackson could be nice.
If you think this issue is not relevant anymore, please feel free to close it. Thanks for the answer.