Serialized JSON with sorted keys, using Jackson
The documentation for SORT_PROPERTIES_ALPHABETICALLY
explicitly says:
Feature that defines default property serialization order used for POJO fields (note: does not apply to Map serialization!)
So I guess you will need to change your input Map (as you say)
As pointed out, this feature just works for POJOs. However, I think there is a feature request to do the same for Maps, at Jackson Jira; and if not, this sounds like a good addition.
But in the meantime I would second @tim_yates suggestion to use intermediate TreeMap for sorting, serializing that: ordering that Map has will be used as is, so this should work.