Allow case insensitive deserialization of String value into `boolean`/`Boolean` (esp for Excel)
See original GitHub issueAt the moment, com.fasterxml.jackson.databind.deser.std.NumberDeserializers.BooleanDeserializer#_parseBoolean
support only "true"
and "True"
(and the same for false) but fails for values like "TRUE"
It would be great to do the matching case insensitive out of the box (similar to how java.lang.Boolean#parseBoolean
checks for true)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to enable case-insensitive property name matching with ...
Learn how to enable case-insensitive property name matching while serializing to and deserializing from JSON in .NET.
Read more >How do I deserialize to Boolean.class from Json object in case ...
DeserializationProblemHandler and implement handleWeirdStringValue method in which you can check text and return Boolean.TRUE or Boolean.
Read more >SUSE-SU-2022:1678-1: important: Security update for jackson ...
... property based by default + Allow case insensitive deserialization of String value into 'boolean'/'Boolean' (esp for Excel) + Allow use ...
Read more >SUSE alert SUSE-SU-2022:1678-1 (jackson-databind ...
... property based by default + Allow case insensitive deserialization of String value into 'boolean'/'Boolean' (esp for Excel) + Allow use ...
Read more >Consuming JSON Strings in SQL Server - Redgate Software
The conventional way of dealing with data like this is to let a separate business layer parse a JSON 'document' into some tree...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve sent a PR for the issue: https://github.com/FasterXML/jackson-databind/pull/2132
Ended up re-thinking this and simple also allowing “TRUE” and “FALSE” at this point.
Some further thoughts:
CoercionConfigs
will dictate if “Boolean from String value” itself is allowed at all (and can be easily prevented)