Closed nicu-chiciuc closed 1 year ago
We're using Nest.js with swagger and we have a script that generates a *.d.ts files using typegen like so:
*.d.ts
typegen
typegen ./path-to-openapi/generated/openapi.json > ./path-to-generated/client.generated.d.ts
The issue is that we have some DTOs that are used inside other dtos, for example:
"MainDto": { "type": "object", "properties": { // ... Other properties "reused_data": { "description": "Some description", "allOf": [{ "$ref": "#/components/schemas/ReusedDto" }] }, }, }, // ... After some lines "ReusedDto": { "type": "object", "properties": { "some_email": { "type": "string", "nullable": true }, }, "required": ["some_email"] },
And after running typegen the result is this:
export interface MainDto { reused_data?: { some_email: string | null; }; } // ... some other types export interface ReusedDto { some_email: string | null; }
Is it possible to instead generate it like this instead?
export interface MainDto { reused_data?: ReusedDto; }
We're currently using version 3.14.1, but I've also tested this on the latest version: 5.0.2.
3.14.1
5.0.2
Unfortunately that behaviour is from the upstream library https://github.com/horiuchi/dtsgenerator
We're using Nest.js with swagger and we have a script that generates a
*.d.ts
files usingtypegen
like so:The issue is that we have some DTOs that are used inside other dtos, for example:
And after running
typegen
the result is this:Is it possible to instead generate it like this instead?
We're currently using version
3.14.1
, but I've also tested this on the latest version:5.0.2
.