Most of my DTOs have nullable fields generated like this: id?: number;
. How can I convert these to non-nullable types for fields that are not marked as nullable?
This is an example of my DTO schema:
"UserDTO": {
"type": "object",
"properties": {
"firstName": {
"type": "string",
"nullable": true
},
"lastName": {
"type": "string",
"nullable": true
},
"id": {
"type": "integer",
"format": "int32"
}
}
The code generation process is executed in the following way:
openapi-generator generate --additional-properties=prefixParameterInterfaces=true,typescriptThreePlus=true --remove-operation-id-prefix -i libs/services/defs/swagger.json -g typescript-fetch -o libs/services/src/api