-
Notifications
You must be signed in to change notification settings - Fork 148
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
The behavior of inline schema for allOf #267
Comments
Hi @ymhuang0808 are you suggesting this #217 caused some kind of regression or that there is additional consideration required to support Apologies my head has been out of this code for too long to offer much meaningful insight. If it was a regression I wonder if it would be resolved by adding an if group.discriminator != nil {
return self
} else if case .all = group.type {
// might restore previous consideration of all based on group type
return self
} |
Hi @nicholascross Cheers! 😃 |
Hi both 👋 I think there is a little more involved here and i submitted a patch in #278... Would be great if you could check it out 🙏 |
…ema (#278) * Update TestSpec to include a scenario where allOf is used to change a referenced schemas nullability or description * Update inlineSchema extension on Schema to ignore allOf groups where there is only a single child schema * Update generated fixtures to match expected results after patch * Update CHANGELOG.md * Update TestSpec to include example demonstrated in #267
…ema (yonaskolb#278) * Update TestSpec to include a scenario where allOf is used to change a referenced schemas nullability or description * Update inlineSchema extension on Schema to ignore allOf groups where there is only a single child schema * Update generated fixtures to match expected results after patch * Update CHANGELOG.md * Update TestSpec to include example demonstrated in yonaskolb#267
…ema (yonaskolb#278) * Update TestSpec to include a scenario where allOf is used to change a referenced schemas nullability or description * Update inlineSchema extension on Schema to ignore allOf groups where there is only a single child schema * Update generated fixtures to match expected results after patch * Update CHANGELOG.md * Update TestSpec to include example demonstrated in yonaskolb#267
In version 4.4.0, there is a bug about the inline schema for
allOf
. In the PR #217 , according to the revision ofSources/SwagGenKit/SwaggerExtensions.swift
,allOf
cannot be generated in a certain situation. Theif
condition istrue
when it ONLY occurs inanyOf
oroneOf
, because thediscriminator
will never appears withallOf
.The below OpenAPI example spec shows the
category
inline schema is not generated inPet
.I expect the the SwagGen will generate a inner
Category
class inPet
class model. In fact, theCategory
are not generated.The text was updated successfully, but these errors were encountered: