@@ -53,12 +53,12 @@ protected Deserializer(T[] values, EnumSet<JsonParser.Event> acceptedEvents) {
53
53
for (T member : values ) {
54
54
String jsonValue = member .jsonValue ();
55
55
if (jsonValue != null ) { // _Custom enum members have a null jsonValue
56
- this .lookupTable .put (jsonValue , member );
56
+ this .lookupTable .put (jsonValue . toLowerCase () , member ); // lookup must be case-insensitive
57
57
}
58
58
String [] aliases = member .aliases ();
59
59
if (aliases != null ) {
60
60
for (String alias : aliases ) {
61
- this .lookupTable .put (alias , member );
61
+ this .lookupTable .put (alias . toLowerCase () , member );
62
62
}
63
63
}
64
64
}
@@ -79,7 +79,7 @@ public T deserialize(JsonParser parser, JsonpMapper mapper, JsonParser.Event eve
79
79
* @throws JsonParsingException if no matching enum was found
80
80
*/
81
81
public T deserialize (String value , JsonParser parser ) {
82
- T result = this .lookupTable .get (value );
82
+ T result = this .lookupTable .get (value . toLowerCase () );
83
83
if (result == null ) {
84
84
throw new JsonpMappingException ("Invalid enum '" + value + "'" , parser .getLocation ());
85
85
}
@@ -94,7 +94,7 @@ public T deserialize(String value, JsonParser parser) {
94
94
* @throws IllegalArgumentException if no matching enum was found
95
95
*/
96
96
public T parse (String value ) {
97
- T result = this .lookupTable .get (value );
97
+ T result = this .lookupTable .get (value . toLowerCase () );
98
98
if (result == null ) {
99
99
throw new NoSuchElementException ("Invalid enum '" + value + "'" );
100
100
}
0 commit comments