wcandillon / swagger-js-codegen

A Swagger Codegen for typescript, nodejs & angularjs
Apache License 2.0
693 stars 286 forks source link

Add Content-Type Header #120

Closed chdanielmueller closed 8 years ago

chdanielmueller commented 8 years ago

closes #119

wcandillon commented 8 years ago

@chdanielmueller Is the code snippet below the same version of your PR?

 var consumes = op.consumes || swagger.consumes;
 if(consumes) {
    method.headers.push({ name: 'Content-Type', value: consumes });
 }
chdanielmueller commented 8 years ago

My code basically did the same. I changed the style now to match your input. I did some small changes to it to get the ' in the code:

var consumes = op.consumes || swagger.consumes;
if(consumes) {
    method.headers.push({name: 'Content-Type', value: '\'' + consumes + '\'' });
}
wcandillon commented 8 years ago

@chdanielmueller thks! published on v1.4.0