Support minOccurs=0
Should be optional or undefined if minOccurs=0
Unfortunately I don't believe this is something exposed by the soap library. If it were it could be added, otherwise this lib would need a complete rewrite with a custom XSD parser.
I see that now :(
As is, the wsdl-to-ts cannot really be used with TS's strict nullable setting, as all elements become required.
(Thanks for the quick response, BTW! Great project.)
Yes, the way to handle the situation currently is to either generate the types once and then do manual corrections or, it pains me to say, have objects containing properties whose undefined or null values has been cast to any.
interface ISomeInterface {
description: string; // : string | null - in reality supports xsi:nil="true"
name: string;
restricted: boolean; // ?: boolean - in reality minOccurs="0"
}
const o: ISomeInterface = {
description: null as any,
name: "example",
restricted: undefined as any,
};