Skip to content

System.Text.JSON polymorphic behaviour not supported #2571

@Stepami

Description

@Stepami

Beginning with .NET 7, System.Text.Json supports polymorphic type hierarchy serialization and deserialization with attribute annotations.

https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism

But if we configure swagger to use polymorphism it does not add information about derived type to docs.

As I think, the problem is that [JsonDerivedType] adds implicit discriminator property which can be seen in json string only.

So, it is interesting to know the plans for support of this feature in library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions