Closed drenda closed 2 years ago
Updating from version 0.17.3 to latest version, I've problems with inheritance. I know you changed that part but in my case it broken the model.
I've these models in my openapi.json:
AuditLog
"AuditLog": { "required": [ "operationType", "severity", "type" ], "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "createdDate": { "type": "string", "format": "date-time" }, "lastModifiedDate": { "type": "string", "format": "date-time" }, "createdBy": { "$ref": "#/components/schemas/AuditUser" }, "lastModifiedBy": { "$ref": "#/components/schemas/AuditUser" }, "operationType": { "$ref": "#/components/schemas/AuditType" }, "severity": { "$ref": "#/components/schemas/AuditLogSeverity" }, "remoteAddress": { "type": "string" }, "text": { "type": "string" }, "parentType": { "type": "string" }, "parentId": { "type": "integer", "format": "int64" }, "type": { "type": "string" } }, "discriminator": { "propertyName": "type" } },
and AuditCdr
"AuditCdr": { "required": [ "operationType", "severity" ], "type": "object", "allOf": [ { "$ref": "#/components/schemas/AuditLog" }, { "type": "object", "properties": { "callFrom": { "type": "string" }, "callTo": { "type": "string" }, "callType": { "$ref": "#/components/schemas/CallType" }, "callStartDate": { "type": "string", "format": "date-time" }, "callEndDate": { "type": "string", "format": "date-time" } } } ] },
With ng-open-api 0.17.3 this is what is generated:
/* tslint:disable */ /* eslint-disable */ import { AuditLogSeverity } from './audit-log-severity'; import { AuditType } from './audit-type'; import { AuditUser } from './audit-user'; export interface AuditLog { createdBy?: AuditUser; createdDate?: string; id?: number; lastModifiedBy?: AuditUser; lastModifiedDate?: string; operationType: AuditType; parentId?: number; parentType?: string; remoteAddress?: string; severity: AuditLogSeverity; text?: string; type: string; }
and
/* tslint:disable */ /* eslint-disable */ import { AuditLog } from './audit-log'; import { CallType } from './call-type'; export interface AuditCdr extends AuditLog { callEndDate?: string; callFrom?: string; callStartDate?: string; callTo?: string; callType?: CallType; }
This is what I expected and it works fine. After version 0.17.3 instead models are generated in this way:
/* tslint:disable */ /* eslint-disable */ import { AuditLog } from './audit-log'; import { CallType } from './call-type'; export interface AuditCdr { }
The problem is as you can see with AuditCdr that has not any fields. Am I missing something or this is not intended behaviour?
Thanks
Hi, any news about this? Thanks
I'm trying to find some time on it. I could reproduce, so I'm trying to find the cause.
Wonderful. When the new version will be published?
Was already released with 0.20.0.
Updating from version 0.17.3 to latest version, I've problems with inheritance. I know you changed that part but in my case it broken the model.
I've these models in my openapi.json:
AuditLog
and AuditCdr
With ng-open-api 0.17.3 this is what is generated:
and
This is what I expected and it works fine. After version 0.17.3 instead models are generated in this way:
and
The problem is as you can see with AuditCdr that has not any fields. Am I missing something or this is not intended behaviour?
Thanks