New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #5976: set content-type on openapi3 imports #5982
fix #5976: set content-type on openapi3 imports #5982
Conversation
header => header.name === 'Content-Type', | ||
); | ||
|
||
// @ts-expect-error -- ?? | ||
if (body && body.mimeType && noContentTypeHeader) { | ||
paramHeaders = [ | ||
{ | ||
name: 'Content-Type', | ||
disabled: false, | ||
// @ts-expect-error -- ?? | ||
value: body.mimeType, | ||
}, | ||
...paramHeaders, | ||
]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since it doesn't appear to mutate the body, would it make sense for this logic to belong inside prepareHeaders()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me - moved it inside to prepareHeaders
👍
3e55ee8
to
c6a40c3
Compare
Closes #5976
Related to similar past change - #5812
If mime type is set for bodies in the OpenAPI imported spec, we now set the content-type on the generated requests as well.
changelog(Fixes): Added a fix to help set Content-Type header when importing requests from OpenAPI 3 specs of which the mime-type was already specified