Closed flpa closed 1 year ago
Hey, I'm currently working on an API with the following type:
{ "TfcHeaderFilterDTO": { "required": [ "values" ], "type": "object", "properties": { "typeExclude": { "type": "boolean" }, "values": { "type": "array", "items": { "type": "string", "nullable": true } } } } }
The "values" property is supposed to hold an array of nullable Strings. According to this topic, the items should be explicitly marked as nullable in such cases (like in my snippet above): https://community.smartbear.com/t5/Swagger-Open-Source-Tools/Array-null-values/td-p/192153
However, when generating models for the API, the type is generated as follows:
export interface TfcHeaderFilterDto { typeExclude?: boolean; values: Array<string>; }
What I am trying to achieve is something like this, though:
export interface TfcHeaderFilterDto { typeExclude?: boolean; values: Array<string | null>; }
Am I missing something? Or is there a way to make ng-openapi-gen generate the type like that?
This seems like a bug. Unfortunately I'm having little to no time for this project. But I'll try to include it in the next release.
Hey, I'm currently working on an API with the following type:
The "values" property is supposed to hold an array of nullable Strings. According to this topic, the items should be explicitly marked as nullable in such cases (like in my snippet above): https://community.smartbear.com/t5/Swagger-Open-Source-Tools/Array-null-values/td-p/192153
However, when generating models for the API, the type is generated as follows:
What I am trying to achieve is something like this, though:
Am I missing something? Or is there a way to make ng-openapi-gen generate the type like that?