Not sure I understand the exact question, but couple of notes that may help:
1. Use of `@JsonTypeInfo` on Enum types does not really make sense
(here for MyEnum), since enum types can not be extended. (not a big
problem here, but worth mentioning). Adding @JsonTypeInfo on enum has
no effect on Set, Map, since the declared value base type is not
MyEnum.
2. Use of `@JsonTypeInfo` for structured types (Collections, Maps,
arrays) affects main-level values/elements. So, works fine for
`Set<Object>` (which is what `Set<?>` is from Jackson's perspective),
but not really for multiple levels (Map<String, Set<?>> ) -- in latter
case it'd mean "polymorphic subtype of Set<?>"
I assume (2) is the problem wrt nested Maps: polymorphic handling can
only be enabled for the immediate child value, but not to the
innermost level.
You could, however, declare your own special `Set` type there... something like
@JsonTypeInfo(....)
static class MySet<T> extends HashSet<T> { }
and then use that
> Map<String, MySet<?> mapOfEnumSets = new LinkedHashMap<>( );
in declaration. This would, I think, force inclusion and use of
polymorphic type information.
-+ Tatu +-