Open ymhuang0808 opened 3 years ago
Hi @ymhuang0808 are you suggesting this #217 caused some kind of regression or that there is additional consideration required to support allOf
inline as well?
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 else if
to consider all
separately.
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
Thanks for your kind reply. Yes, the PR #217 makes the inline class for allOf
broken. The code snippet works for the allOf
in inline class. Would you like to make a pull request?
Cheers! :smiley:
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 š
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.