Skip to content

a minimum project for reproducing convertConstructorInterfaceData not working in inheritence

Notifications You must be signed in to change notification settings

thebestnom/NJsonSchemaInheritenceBug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NJsonSchemaInheritenceBug

a minimum project for reproducing convertConstructorInterfaceData not working in inheritence

Fixed in last version of nswag!!

the model is a base class Dad and inherited class Son, and random class RandomClass

Both Dad and Son have RandomClass inside them, and setting convertConstructorInterfaceData to true should add

this.{class}RandomClassDto = data.{class}RandomClassDto && !(<any>data.{class}RandomClassDto).toJSON ? new RandomClass(data.{class}RandomClassDto) : <RandomClass>this.{class}RandomClassDto;

to both constructor

the bug is that only Dad (the base class) have this in the constructor and Son (the inherited class) only calls super

you can run it by first installing with yarn (or npm i... not judging) then running it by yarn rerun-nswag (or npm run rerun-nswag)

you can easily see that

About

a minimum project for reproducing convertConstructorInterfaceData not working in inheritence

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published