cargocult - 2011-08-10

It would be nice if Java enums could be also converted to JSON as ordinals, not just as Strings.  (Should that work one day it would be then great if that could work the other way around too, from JSON to beans.)

I am implementing a specification which comprises (among others) lots and lots of enums, all of which MUST appear in the JSON text as integers, however.  Json-lib 2.3 uses the string representation of the enums in the text output, which is cool and convenient in most cases, unless, like in my case, if the specification of the given interface requires otherwise.

Hence I was compelled to use Integer and List<Integer> everywhere in my code where I actually needed enums or lists of enums, respectively, because I found no way to make json-lib use the ordinals of the enums instead of the names of the enum values.  (EnumMorpher is great, but it is for the opposite direction and from 2.2 obsolete anyways.)

I would really appreciate if any future release would allow to choose whether to use names or ordinals in both directions.