Join GitHub today
Specify @Serializer/Group for @Discriminator field #506
This is a example code. How to add "type" filed into a specific group ?
I've just run into a similar issue - if I'm using groups, then the discriminator will not appear in the serialized data.
I found that if my serialization context contained 'Default', then the discriminator will appear. So, one workaround is to ensure that all fields either have groups or are excluded, and always serialized with a context of Default + whatever groups you want.
It would be nice if there was a way to specify which groups the discriminator should appear in.