-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Swagger Inheritance & Polymorphism is not generating correctly from the OpenApi definition. this is directly related to #1940. But i am recording this as a seperate issue because it references a different case but is most probably a related error in the code.
I have striped down the situation as to not clutter the issue.
When a openApi schema has an Entity
base type and a subtype called Project
, and is defined simply as Project -> allOf -> Entity
with no descriminators or anything just a simple inheritance the Project
entity is not correctly generated.
RTK Generator produces the following type output:
export type Entity= {
id?: string | null;
name?: string | null;
description?: string | null;
status?: string | null;
};
export type Project = Entity
This is incorrect and seems to have 2 mistakes:
- all additional properties on a subtype are lost due to the
Project = Entity
. - the missing properties are caused because the code gen creates
type
s notinterface
s which cannot be extended.
Metadata
Metadata
Assignees
Labels
No labels