Skip to content

Commit 1881327

Browse files
committed
Work on #422
1 parent 11f7811 commit 1881327

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ protected final boolean _parseBooleanPrimitive(JsonParser jp, DeserializationCon
123123
// And finally, let's allow Strings to be converted too
124124
if (t == JsonToken.VALUE_STRING) {
125125
String text = jp.getText().trim();
126-
if ("true".equals(text)) {
126+
// [#422]: Allow aliases
127+
if ("true".equals(text) || "True".equals(text)) {
127128
return true;
128129
}
129-
if ("false".equals(text) || text.length() == 0) {
130+
if ("false".equals(text) || "False".equals(text) || text.length() == 0) {
130131
return false;
131132
}
132133
if (_hasTextualNull(text)) {
@@ -173,10 +174,11 @@ protected final Boolean _parseBoolean(JsonParser jp, DeserializationContext ctxt
173174
// And finally, let's allow Strings to be converted too
174175
if (t == JsonToken.VALUE_STRING) {
175176
String text = jp.getText().trim();
176-
if ("true".equals(text)) {
177+
// [#422]: Allow aliases
178+
if ("true".equals(text) || "True".equals(text)) {
177179
return Boolean.TRUE;
178180
}
179-
if ("false".equals(text)) {
181+
if ("false".equals(text) || "False".equals(text)) {
180182
return Boolean.FALSE;
181183
}
182184
if (text.length() == 0) {

0 commit comments

Comments
 (0)