-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[BUG] Composed properties are missing from allVars #3613
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Seems like this might affect more than just allVars… required/optional/parent/readonly/readwrite. |
@jimschubert I think because of the location of my fix those other template vars will be updated too (by the |
I've also run into a question about this code in // child schema (properties owned by the schema itself)
for (Schema component : interfaces) {
if (component.get$ref() == null) {
if (component != null) {
// component is the child schema
addProperties(properties, required, component);
// includes child's properties (all, required) in allProperties, allRequired
addProperties(allProperties, allRequired, component);
}
break; // at most one child only
}
} It looks at the component parts to find the one that has an empty I'm not sure if this suggests another bug or i'm just misunderstanding the purpose of this code. |
Description
When a model includes properties by composition (
allOf
, without a discriminator), these properties end up in thevars
template variable but they are missing from theallVars
variable.I would expect
allVars
to include, at minimum, everything invars
. Some generators only iterateallVars
when producing a model class, so they will be missing these composed properties.openapi-generator version
4.1.0
OpenAPI declaration file content or url
https://gist.github.com/glennschmidt/d5e87fe518ac5afc7c39032ae1df479e
Command line used for generation
openapi-generator generate -i openapi.json -g swift4 -o apigen
Steps to reproduce
apigen/OpenAPIClient/Classes/OpenAPIs/Models/EventCollection.swift
It will contain
ie. The EventCollection model has no properties, but it should have
Suggest a fix
In
DefaultCodegen.fromModel()
, when adding composed properties toproperties
, also add them toallProperties
(i will submit a PR with this).The text was updated successfully, but these errors were encountered: