Libgdx Json serialization of HashMap

So I got a problem when trying to serialize a HashMap<Integer, Actions> where the Actions are an enum type.
If I try to deserialize the HashMap, the keys are not integers anymore but strings and I have absolutely no idea how to fix this.
I would really appreciate some help :slight_smile:

This is the code:


HashMap<Integer, Actions> val = new HashMap<Integer,Actions>();
		val.put(0, Actions.Left);
		val.put(1, Actions.Right);
		FileHandle file = new FileHandle("test.json");
		file.writeString(json.toJson(val, HashMap.class), false);
		HashMap<Integer,Actions> newVal = json.fromJson(HashMap.class, file);
		System.out.println(newVal.get("0"));