Closed christrude closed 8 years ago
** UPDATE ***
I'm a dumb dumb and didn't realize I could've just put the following in my mustache template. This is the correct answer. It takes the proper 'consumes' and 'produces' properties and ensures the right headers are being sent.
{{#headers}}
options.headers['{{&name}}'] = {{&value}};
{{/headers}}
So I have newly upgraded to Swagger 2 from 1.x, and am experiencing an odd issue. One of my APIs is getting an incorrect content-type injected into the header and I have no idea where from, you can see below in the SwaggerJSON, The DELETE function even says it consumes application/json, but the CURL(copied from inspect panel) for it sends 'Content-Type: text/plain;charset=UTF-8'. I have provided the CREATE function as a cursory example to show that otherwise the api works fine. I think this is an issue with swagger-js-codegen because if I put the same request into the api-docs it works fine.
Any Ideas?