diff --git a/index.js b/index.js index f9c7f2a..a349090 100644 --- a/index.js +++ b/index.js @@ -580,7 +580,6 @@ handlebars.registerHelper('isXmlMediaType', helpers.isXmlMediaType); handlebars.registerHelper('isPdfMediaType', helpers.isPdfMediaType); handlebars.registerHelper('isNecessaryBody', helpers.isNecessaryBody); - module.exports = { testGen: testGen }; diff --git a/templates/request/get/get.handlebars b/templates/request/get/get.handlebars index d7f4d0a..f4b239c 100644 --- a/templates/request/get/get.handlebars +++ b/templates/request/get/get.handlebars @@ -124,7 +124,7 @@ method: 'GET', headers: { 'Content-Type': '{{contentType}}'{{#if headerParameters}}, - {{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, + {{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, {{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}}, Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}} } diff --git a/templates/request/patch/patch.handlebars b/templates/request/patch/patch.handlebars index cbd1095..3b52666 100644 --- a/templates/request/patch/patch.handlebars +++ b/templates/request/patch/patch.handlebars @@ -153,7 +153,7 @@ method: 'PATCH', headers: { 'Content-Type': '{{contentType}}'{{#if headerParameters}}, - {{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, + {{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, {{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}}, Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}} }, diff --git a/templates/request/post/post.handlebars b/templates/request/post/post.handlebars index 02dae5b..365391a 100644 --- a/templates/request/post/post.handlebars +++ b/templates/request/post/post.handlebars @@ -151,7 +151,7 @@ method: 'POST', headers: { 'Content-Type': '{{contentType}}'{{#if headerParameters}}, - {{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, + {{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, {{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}}, Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}} }, diff --git a/templates/request/put/put.handlebars b/templates/request/put/put.handlebars index 9a93ece..5540a6b 100644 --- a/templates/request/put/put.handlebars +++ b/templates/request/put/put.handlebars @@ -151,7 +151,7 @@ method: 'PUT', headers: { 'Content-Type': '{{contentType}}'{{#if headerParameters}}, - {{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, + {{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}}, {{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}}, Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}} }, diff --git a/templates/supertest/delete/delete.handlebars b/templates/supertest/delete/delete.handlebars index 3c94243..774dd02 100644 --- a/templates/supertest/delete/delete.handlebars +++ b/templates/supertest/delete/delete.handlebars @@ -20,7 +20,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} diff --git a/templates/supertest/get/get.handlebars b/templates/supertest/get/get.handlebars index a5e2c93..61c8554 100644 --- a/templates/supertest/get/get.handlebars +++ b/templates/supertest/get/get.handlebars @@ -20,7 +20,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} @@ -113,7 +113,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} diff --git a/templates/supertest/head/head.handlebars b/templates/supertest/head/head.handlebars index 64f1cd1..d4bc0fa 100644 --- a/templates/supertest/head/head.handlebars +++ b/templates/supertest/head/head.handlebars @@ -20,7 +20,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} diff --git a/templates/supertest/options/options.handlebars b/templates/supertest/options/options.handlebars index d4a71a9..c505969 100644 --- a/templates/supertest/options/options.handlebars +++ b/templates/supertest/options/options.handlebars @@ -20,7 +20,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} @@ -81,7 +81,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} diff --git a/templates/supertest/patch/patch.handlebars b/templates/supertest/patch/patch.handlebars index 71a2a3f..173aebd 100644 --- a/templates/supertest/patch/patch.handlebars +++ b/templates/supertest/patch/patch.handlebars @@ -20,7 +20,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} @@ -147,7 +147,7 @@ {{#is contentType 'application/json'}} .send({ {{#each bodyParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/is}} diff --git a/templates/supertest/post/post.handlebars b/templates/supertest/post/post.handlebars index 2efcda1..5a8ded0 100644 --- a/templates/supertest/post/post.handlebars +++ b/templates/supertest/post/post.handlebars @@ -19,7 +19,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} @@ -136,7 +136,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} diff --git a/templates/supertest/put/put.handlebars b/templates/supertest/put/put.handlebars index 49b7927..bc6a5cd 100644 --- a/templates/supertest/put/put.handlebars +++ b/templates/supertest/put/put.handlebars @@ -19,7 +19,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}} @@ -136,7 +136,7 @@ {{#if headerParameters}} .set({ {{#each headerParameters}} - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} {{/each}} }) {{/if}}