-
I was wondering what is the significance that the typescript client, and the go clients can return undefined and nil, even if there is no error(go), and no error was thrown(ts). When does this happen? And why is this not converted to an error? How should I handle this case? https://github.com/microsoftgraph/msgraph-sdk-go/blob/067c7ca48959fdc758e8798ad53887cd7e825d59/admin/admin_request_builder.go#L70 https://github.com/microsoftgraph/msgraph-sdk-typescript/blob/1f898c60ebe711c571c8f940d46b7b4756b1deac/packages/msgraph-sdk-admin/admin/people/profileCardProperties/item/index.ts#L38 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
For anyone wandering here I have found the related issue #3911, that should be upvoted if this affects you. |
Beta Was this translation helpful? Give feedback.
Hi,
Thank you for using kiota and for reaching out .
The reason why the responses are nullable is because a lot of APIs out there technically can return a 204 or a 201 with no content and most of them do not document that as part of their open API specification.
For that reason, instead of requiring everyone to amend their description, we made an assumption that this is common behavior and the client should account for that.
The alternative being if it's not strictly in the open API description and we don't get a content in the response to throw an exception instead and this would be pretty aggressive as a design decision. We already received some feedback that throwing exceptions on non-…