Unsure on the generated request for 204 (and by extension 201) requests, with no content #6411
-
So I have a situation where in an openApi spec I'm provided has a 204, and a default configured. The request generated by Kiota includes an Accept header with the default content type in it, whereas a 204 has no content configured as an empty response type, from the spec. The upshot of this, is the default is an "error" response with an error app type. when this is provided to the endpoint expecting a 204, it complains that the I have exampled this with the below:
where if you run the default kiota generation on it:
it has the following in the generated builder for the Data object:
Mainly, I'm trying to work out if I either: Go to the provider of this OpenAPI spec and say that they either need to provide the acceptable "Accept" headers for a 204. OR they broaden their acceptable |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @JSparshottO2 In kiota, default should only be used for error responses (generating the exception types) kiota/src/Kiota.Builder/KiotaBuilder.cs Line 1250 in 6c20342 I believe this case is what you're going through. kiota/src/Kiota.Builder/KiotaBuilder.cs Line 1449 in 6c20342 The conditions line 1450 and 1455 are wrong, they should also exclude: default, 4XX and 5XX Is this something you'd like to submit a pull request for provided some guidance? |
Beta Was this translation helpful? Give feedback.
Hi @JSparshottO2
Thank you for using kiota and for reaching out.
In kiota, default should only be used for error responses (generating the exception types)
kiota/src/Kiota.Builder/KiotaBuilder.cs
Line 1250 in 6c20342
I believe this case is what you're going through.
kiota/src/Kiota.Builder/KiotaBuilder.cs
Line 1449 in 6c20342
The conditions line 1450 and 1455 are wrong, they should also exclude: default, 4XX and 5XX
Is this something you'd like to submit a pull requ…