kiota: Add a way to get response body for error responses

I generated a client with Kiota, based on an OpenAPI spec, which does not specify error codes, hence errorMapping is empty in Kiota-generated client. The ApiException that Kiota throws contains just the status code and response headers. Is there any way to read the actual response body (as string) without modifying the Kiota-generated client code?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 21 (17 by maintainers)

Most upvoted comments

We could potentially decide to wrap the response into untyped json constructs when we don’t have a mapping, and attach that to API error. Of course that assumes the response is JSON

The design PR has been merged. I also created a bunch of implementation issues (list below) that I recommend anyone following this issue to go subscribe to. Closing to clear confusion. @marcinjahn is this something you’d like to submit a pull request for provided some guidance? If so please jump on the issue for the language you’re interested in.

Here is the list of issues:

yes that what I meant