Bug Report Checklist
Description
Installed v6.0.0, noticed that base class / derived class relationships no longer show up in generated Java and Swift models.
OpenAPI declaration file content or url
components:
schemas:
BaseClass:
type: object
properties:
id:
type: integer
name:
type: string
DerivedClass:
type: object
allOf:
- $ref: "#/components/schemas/BaseClass"
- type: object
properties:
derivedData:
type: string
Steps to reproduce
Generate models using openapi-generator generate -i spec.yml -g java and openapi-generator generate -i spec.yml -g swift5 --additional-properties=useClasses=true
The resulting Java code for DerivedClass looks like this:
public class DerivedClass {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private Integer id;
// ...
}
and the Swift version has
public final class DerivedClass: Codable, JSONEncodable, Hashable {
// ...
}
i.e. in both cases, information about the inheritance is lost.
In the Swift case, the base class is erroneously generated as final,
public final class BaseClass: Codable, JSONEncodable, Hashable {
// ...
}
which prohibits inheriance, even if the code for DerivedClass were generated correctly.
Bug Report Checklist
Description
Installed v6.0.0, noticed that base class / derived class relationships no longer show up in generated Java and Swift models.
OpenAPI declaration file content or url
Steps to reproduce
Generate models using
openapi-generator generate -i spec.yml -g javaandopenapi-generator generate -i spec.yml -g swift5 --additional-properties=useClasses=trueThe resulting Java code for
DerivedClasslooks like this:and the Swift version has
i.e. in both cases, information about the inheritance is lost.
In the Swift case, the base class is erroneously generated as
final,which prohibits inheriance, even if the code for
DerivedClasswere generated correctly.