Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneOf and anyOf with discriminator #121

Merged
merged 2 commits into from
Feb 25, 2019
Merged

oneOf and anyOf with discriminator #121

merged 2 commits into from
Feb 25, 2019

Conversation

yonaskolb
Copy link
Owner

@yonaskolb yonaskolb commented Feb 25, 2019

Followup to the Swagger 3 changes in #118
This adds support for the new oneOf and anyOf types when used with a discriminator, including when they are in an array.
The generated type is an enum with associated cases as can be seen here https://github.com/yonaskolb/SwagGen/compare/discriminated_types?expand=1#diff-cf37eaf2302754a88433e18c46b1b6c5

  • oneOf anyOf
  • discriminator
  • custom mapping in discriminator
  • used in arrays
  • swift template

Note that this PR does not provide support for polymorphic inheritance using allOf

@yonaskolb yonaskolb merged commit 4ed04b4 into master Feb 25, 2019
@yonaskolb yonaskolb deleted the discriminated_types branch February 25, 2019 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant