You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result is {"km":200} and not {"km":200, "type":"car"}
I guess the issue comes from the exclusion strategy. The discriminator field does not belong to the "details" group and is excluded.
Is there a way to force the creation of this field? Does it belong to a hidden group?
If it is not the case, I suggest adding a default group to every discriminator field (e.g. "_discriminator") to make possible to see them by adding this group in the SerializationContext.
For instance, I could obtain the expected result with the following code:
It seems impossible to combine discriminator and group exclusion strategy. For instance:
The result is {"km":200} and not {"km":200, "type":"car"}
I guess the issue comes from the exclusion strategy. The discriminator field does not belong to the "details" group and is excluded.
Is there a way to force the creation of this field? Does it belong to a hidden group?
If it is not the case, I suggest adding a default group to every discriminator field (e.g. "_discriminator") to make possible to see them by adding this group in the SerializationContext.
For instance, I could obtain the expected result with the following code:
The text was updated successfully, but these errors were encountered: