Open deyaaeldeen opened 1 year ago
For simple types like string/boolean/number, it seems we can't do this way ?
How about having a function to unset all those undefined value keys ?
For simple types like string/boolean/number, it seems we can't do this way ?
This issue is about how to set properties inside the result object and nested objects. Are you asking what to do if the result is of a primitive type?
The deserialization logic generated for modular libraries inserts
undefined
when an optional property is absent. This doesn't seem necessary and can be confusing. See https://github.com/Azure/autorest.typescript/blob/d350fb2ecc83b6302edf9bb55c577809865bca51/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/api/operations.ts#L133-L135Here is an example of code that doesn't do this insertion: