@@ -53,12 +53,12 @@ protected Deserializer(T[] values, EnumSet<JsonParser.Event> acceptedEvents) {
5353 for (T member : values ) {
5454 String jsonValue = member .jsonValue ();
5555 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
5757 }
5858 String [] aliases = member .aliases ();
5959 if (aliases != null ) {
6060 for (String alias : aliases ) {
61- this .lookupTable .put (alias , member );
61+ this .lookupTable .put (alias . toLowerCase () , member );
6262 }
6363 }
6464 }
@@ -79,7 +79,7 @@ public T deserialize(JsonParser parser, JsonpMapper mapper, JsonParser.Event eve
7979 * @throws JsonParsingException if no matching enum was found
8080 */
8181 public T deserialize (String value , JsonParser parser ) {
82- T result = this .lookupTable .get (value );
82+ T result = this .lookupTable .get (value . toLowerCase () );
8383 if (result == null ) {
8484 throw new JsonpMappingException ("Invalid enum '" + value + "'" , parser .getLocation ());
8585 }
@@ -94,7 +94,7 @@ public T deserialize(String value, JsonParser parser) {
9494 * @throws IllegalArgumentException if no matching enum was found
9595 */
9696 public T parse (String value ) {
97- T result = this .lookupTable .get (value );
97+ T result = this .lookupTable .get (value . toLowerCase () );
9898 if (result == null ) {
9999 throw new NoSuchElementException ("Invalid enum '" + value + "'" );
100100 }
0 commit comments