Recently we came across a scenario, in which smartdocs by default assign the Content-Type header as “application/json; charset=UTF-8” for POST requests. But the actual Content-Type header given as the header input is application/json.
Any idea why this is happening. I have also attached screenshots for reference.
Screen 1 - Header Parameters given as input in smartdocs:
One thing I have observed while struggling with this issue is when I am defining the body payload schema inline in Open API Specs, then the Content-Type header is sent as “application/json” i.e. exactly what I am sending in the input box. But, when I am defining the body payload schema through the reference, then smartdocs automatically appends “;charset=UTF-8”, no matter what is given as input in Content-Type header. Example: If I send “application/xml” , it is automatically getting converted to “application/xml ;charset=UTF-8”
If I send “application/json; charset=UTF-16”, then smartdocs is sending “application/json; charset=UTF-8”, i.e., sending different charset does not override the charset value.
Note: I am defining the body payload schema from reference schema since inline schema definition is not working in smartdocs, as suggested by @Madhan Sadasivam in the below community article: