Open robbie-johnstone-bjss opened 9 months ago
I second this. Currently it does not seem possible to have NestJS OpenAPI Generator create classes.
Interfaces can not be used in conjunction with @nestjs/ swagger
decorators for instance, which can be useful in some situations.
Bug Report Checklist
Description
My understanding of the NestJS OpenAPI Generator docs is that by not including the
withInterfaces
flag, I should expect models to instead be generated as classes.Removing or setting this flag to false continues to output interfaces in typescript.
openapi-generator version
7.2
OpenAPI declaration file content or url
https://openapi-generator.tech/docs/generators/typescript-nestjs/#:~:text=false-,withInterfaces,-Setting%20this%20property
Generation Details
Language set to typescript-nestjs (by default this should set
withInterfaces
to false)Steps to reproduce
Run
npx @openapitools/openapi-generator-cli generate -i <location-of-openapi-spec> -g typescript-nestjs -o <your-output-dir>
Example OpenAPI spec
I would expect the file
dummyClass.ts
to have a class within it, but instead it has an interface.I am aware that the nestjs generator is considered experimental, but I had thought I'd seen this working previously, though I can't confirm.