vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client
MIT License
1.14k stars 237 forks source link

missing override keyword when creating fromData method on inherited class #1041

Open alebo611 opened 9 months ago

alebo611 commented 9 months ago

If a class A inherits class B, the resulting typescript classes will both have each a fromData method. However, A, must have the keyword is missing the "override" keyword in order to be syntactically correct typescript.

wrong: static fromData(data: FooBar, target?: FooBar): FooBar {

correct: static override fromData(data: FooBar, target?: FooBar): FooBar {

leomayer commented 9 months ago

I have the same problem. I get exported

export class EditChapterDto extends ChapterDto<EditChapterDto> {
  children: EditChapterDto[];

but I need to have

export class EditChapterDto extends ChapterDto<EditChapterDto> {
   override  children: EditChapterDto[];