[x] Add JsonUnionEncoding.UnionFieldNamesFromTypes so that union fields that don't have an explicit name are named after their type instead. If a union case has several fields with the same type, a suffix 1, 2, etc is added.
[x] Add unionFieldNamingPolicy option to specify the policy used to name JSON fields for union fields. If unspecified, use the standard PropertyNamingPolicy.
JsonUnionEncoding.UnionFieldNamesFromTypes
so that union fields that don't have an explicit name are named after their type instead. If a union case has several fields with the same type, a suffix1
,2
, etc is added.unionFieldNamingPolicy
option to specify the policy used to name JSON fields for union fields. If unspecified, use the standardPropertyNamingPolicy
.