I may be wrong, but I think that the code may have been relying on a flaw in JsonGenerator, where code did not verify proper sequencing of FIELD_NAMEs and matching values.
I realize that from user perspective it is a semantic change, but the intent was never to allow writing of sequences of values within JSON Object. The missing check was making it more difficult to catch other broken usage that resulted in invalid JSON being written without exception to caller.
So, yes, there is a difference between value and key serializers, from the earlier Jackson version.
This is not an ideal situation (if I was writing Jackson from Scratch, I'd make JsonSerializer have separate method), but it has existed from the beginning.
One possible fix might be to allow use of `@JsonValue` for key serialization. I don't remember if this is already done for case where return value is `String`. If not, I would be happy to work on this as an RFE.
Another thing that might help is that `toString()` may be used for key serialization as well, depending on SerializationFeature.WRITE_ENUMS_USING_TO_STRING.
-+ Tatu +-