Skip to content

Why are responses nullable? #4926

Closed Answered by baywet
vkhobor asked this question in Q&A
Jul 2, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

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-…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@vkhobor
Comment options

@baywet
Comment options

baywet Jul 3, 2024
Collaborator

Answer selected by vkhobor
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants