Closed pbn4 closed 3 years ago
same with these example
@Manweill They are not the same when strict null check is enabled. So is there a way to generate this 1st kind of interface I specified?
I see that here https://github.com/Manweill/swagger-axios-codegen/blob/master/src/templates/template.ts#L44 is a check for nullable prop but an optional operator is always used. What do you think about adding optional operator based on required
and | null
union based on "nullable"?
set codegen
options.strictNullCheck=true
let obj: {
a: number | null | undefined;
b?: number | null | undefined;
} = {
}
@pbn4 There is only one difference between the two writing methods. When initializing obj, a
must be defined, b
is not
Long time is not active!
I would like to have an interface with properties that are a union of a specific type and a null instead of '?' (undefined), e.g.:
instead of:
is there a way to achieve that with this library?