CenterEdge / Yardarm

OpenAPI 3 SDK Generator for C#
Apache License 2.0
46 stars 6 forks source link

Handle more polymorphism cases for System.Text.Json #171

Closed brantburnett closed 1 year ago

brantburnett commented 1 year ago

Motivation

We are currently only handling oneOf polymorphism with explicitly defined type mappings. There are cases where we should be mapping by default based on schema name. There are also cases we should be handling where anyOf is used for polymorphism instead of oneOf.

Modifications

Find mappings automatically based on defaults if there are no explicit mappings defined. Also apply a converter to classes used as a base for anyOf polymorphism instead of only applying to oneOf.

brantburnett commented 1 year ago

/merge