question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow case insensitive deserialization of String value into `boolean`/`Boolean` (esp for Excel)

See original GitHub issue

At 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:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
remalcommented, Sep 7, 2018
0reactions
cowtowncodercommented, Jun 25, 2020

Ended up re-thinking this and simple also allowing “TRUE” and “FALSE” at this point.

Some further thoughts:

  1. With 2.12, CoercionConfigs will dictate if “Boolean from String value” itself is allowed at all (and can be easily prevented)
  2. If more granular control over “but which String values” needed, two main approaches: for most advanced, custom deserializer suggested; but if case-insensitive was still desired, could then use strict/lenient setting – however, not sure there will be need for that.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found