Repository: postmanlabs/postman-code-generators
Pull request #659 (2022-12-16 11:08:12)

Release/1.3.0
v1.3.0 (December 16, 2022)
* Update C# restsharp codegen to support (107)[https://restsharp.dev/v107/]
* Fixes an issue where HTTP code snippet was generating wrong boundaries (11084)[https://github.com/postmanlabs/postman-app-support/issues/11084]
* Fixes an issue with Axios code snippets not including maxBodyLength param


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e713ef..aa5bf96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+v1.3.0 (December 16, 2022)
+* Update C# restsharp codegen to support (107)[https://restsharp.dev/v107/]
+* Fixes an issue where HTTP code snippet was generating wrong boundaries (11084)[https://github.com/postmanlabs/postman-app-support/issues/11084]
+* Fixes an issue with Axios code snippets not including maxBodyLength param
+
 v1.2.1 (April 26, 2022)
 * Add label for 'R' language
 
@@ -61,4 +66,4 @@ v1.0.1 (Jun 29, 2020)
 v1.0.0 (May 29, 2020)
 - Add axios framework support
 - Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
-- Fix snippet generation for powershell and jquery, where form data params had no type field
\ No newline at end of file
+- Fix snippet generation for powershell and jquery, where form data params had no type field
diff --git a/codegens/csharp-restsharp/lib/parseRequest.js b/codegens/csharp-restsharp/lib/parseRequest.js
index c1d771c..c79d2e3 100644
--- a/codegens/csharp-restsharp/lib/parseRequest.js
+++ b/codegens/csharp-restsharp/lib/parseRequest.js
@@ -41,6 +41,49 @@ function parseContentType (request) {
   return request.getHeaders({enabled: true, ignoreCase: true})['content-type'] || 'text/plain';
 }
 
+/**
+ * Generates a parameter using AddStringBody method
+ *
+ * @param {Object} requestBody - JSON object representing body of request
+ * @param {string} dataFormat - the data format to use "DataFormat.Json" or "DataFormat.Xml"
+ * @returns {String} snippet of the parameter generation
+ */
+function getAddStringBodyParam (requestBody, dataFormat) {
+  return `var body = ${requestBody[requestBody.mode]
+    .split('\n')
+    .map((line) => { return '@"' + line.replace(/"/g, '""') + '"'; })
+    .join(' + "\\n" +\n')};\n` +
+    `request.AddStringBody(body, ${dataFormat});\n`;
+}
+
+/**
+ * Parses Raw data
+ *
+ * @param {Object} request - JSON object representing body of request
+ * @param {Object} requestBody - JSON object representing body of request
+ * @returns {String} snippet of the body generation
+ */
+function parseRawBody (request, requestBody) {
+  let bodySnippet = '',
+    contentType = parseContentType(request);
+  if (contentType && (contentType === 'application/json' || contentType.match(/\+json$/))) {
+    bodySnippet = getAddStringBodyParam(requestBody, 'DataFormat.Json');
+  }
+  else if (contentType && (contentType === 'text/xml' || contentType.match(/\+xml$/))) {
+    bodySnippet = getAddStringBodyParam(requestBody, 'DataFormat.Xml');
+  }
+  else {
+    bodySnippet = `var body = ${requestBody[requestBody.mode]
+      .split('\n')
+      .map((line) => { return '@"' + line.replace(/"/g, '""') + '"'; })
+      .join(' + "\\n" +\n')};\n` +
+      `request.AddParameter("${contentType}", ` +
+      'body,  ParameterType.RequestBody);\n';
+  }
+
+  return bodySnippet;
+}
+
 /**
  *
  * @param {Object} requestBody - JSON object representing body of request
@@ -78,12 +121,7 @@ function parseBody (request, trimFields) {
       case 'formdata':
         return parseFormData(requestBody, trimFields);
       case 'raw':
-        return `var body = ${requestBody[requestBody.mode]
-          .split('\n')
-          .map((line) => { return '@"' + line.replace(/"/g, '""') + '"'; })
-          .join(' + "\\n" +\n')};\n` +
-          `request.AddParameter("${parseContentType(request)}", ` +
-          'body,  ParameterType.RequestBody);\n';
+        return parseRawBody(request, requestBody);
       case 'graphql':
         return parseGraphQL(requestBody, trimFields);
         /* istanbul ignore next */
@@ -110,10 +148,7 @@ function parseHeader (requestJson) {
 
   return requestJson.header.reduce((headerSnippet, header) => {
     if (!header.disabled) {
-      if (sanitize(header.key, true).toLowerCase() === 'user-agent') {
-        headerSnippet += `client.UserAgent = "${sanitize(header.value)}";\n`;
-      }
-      else {
+      if (sanitize(header.key, true).toLowerCase() !== 'user-agent') {
         headerSnippet += `request.AddHeader("${sanitize(header.key, true)}", "${sanitize(header.value)}");\n`;
       }
     }
diff --git a/codegens/csharp-restsharp/lib/restsharp.js b/codegens/csharp-restsharp/lib/restsharp.js
index ec0b86b..46c7b2a 100644
--- a/codegens/csharp-restsharp/lib/restsharp.js
+++ b/codegens/csharp-restsharp/lib/restsharp.js
@@ -4,32 +4,100 @@ var _ = require('./lodash'),
   sanitize = require('./util').sanitize,
   sanitizeOptions = require('./util').sanitizeOptions,
   addFormParam = require('./util').addFormParam,
+  { URL } = require('url'),
   self;
 
 /**
- * Generates snippet in csharp-restsharp by parsing data from Postman-SDK request object
+* Takes in a string and returns a new string with only the first character capitalized
+*
+* @param  {string} string - string to change
+* @returns {String} - the same string with the first litter as capital letter
+*/
+function capitalizeFirstLetter (string) {
+  return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
+}
+
+/**
+ * Generates snippet for the RestClientOptions object
  *
- * @param {Object} request - Postman SDK request object
+ * @param {string} urlOrigin - String representing the origin of the url
  * @param {Object} options - Options to tweak code snippet
- * @returns {String} csharp-restsharp code snippet for given request object
+ * @param {string} indentString - String representing value of indentation required
+ * @param {Array} headers - request headers
+ * @returns {String} csharp-restsharp RestClientOptions object snippet
  */
-function makeSnippet (request, options) {
-  const UNSUPPORTED_METHODS_LIKE_POST = ['LINK', 'UNLINK', 'LOCK', 'PROPFIND'],
-    UNSUPPORTED_METHODS_LIKE_GET = ['PURGE', 'UNLOCK', 'VIEW', 'COPY'];
+function makeOptionsSnippet (urlOrigin, options, indentString, headers) {
+  let userAgentHeader,
+    snippet = `var options = new RestClientOptions("${sanitize(urlOrigin)}")\n{\n`;
+  if (Array.isArray(headers)) {
+    userAgentHeader = headers.find((header) => {
+      return (!header.disabled && sanitize(header.key, true).toLowerCase() === 'user-agent');
 
-  var snippet = `var client = new RestClient("${sanitize(request.url.toString())}");\n`,
-    isUnSupportedMethod = UNSUPPORTED_METHODS_LIKE_GET.includes(request.method) ||
-            UNSUPPORTED_METHODS_LIKE_POST.includes(request.method);
+    });
+  }
   if (options.requestTimeout) {
-    snippet += `client.Timeout = ${options.requestTimeout};\n`;
+    snippet += `${indentString}MaxTimeout = ${options.requestTimeout},\n`;
   }
   else {
-    snippet += 'client.Timeout = -1;\n';
+    snippet += `${indentString}MaxTimeout = -1,\n`;
   }
   if (!options.followRedirect) {
-    snippet += 'client.FollowRedirects = false;\n';
+    snippet += `${indentString}FollowRedirects = false,\n`;
+  }
+  if (userAgentHeader) {
+    snippet += `${indentString}UserAgent = "${userAgentHeader.value}",\n`;
+  }
+  snippet += '};\n';
+  return snippet;
+}
+
+/**
+ * Generates an URL object from the string
+ *
+ * @param {string} stringToParse - url in string representation
+ * @returns {object} the URL object
+ */
+function parseURL (stringToParse) {
+  try {
+    let objectURL = new URL(stringToParse);
+    return objectURL;
+  }
+  catch (err) {
+    try {
+      var url = require('url');
+      let urlObj = url.parse(stringToParse);
+      if (urlObj.hostname === null) {
+        return false;
+      }
+      return urlObj;
+    }
+    catch (parseErr) {
+      return false;
+    }
   }
-  snippet += `var request = new RestRequest(${isUnSupportedMethod ? '' : ('Method.' + request.method)});\n`;
+}
+
+/**
+ * Generates snippet in csharp-restsharp by parsing data from Postman-SDK request object
+ *
+ * @param {Object} request - Postman SDK request object
+ * @param {Object} options - Options to tweak code snippet
+ * @param {string} indentString - String representing value of indentation required
+ * @returns {string} csharp-restsharp code snippet for given request object
+ */
+function makeSnippet (request, options, indentString) {
+  const UNSUPPORTED_METHODS_LIKE_POST = ['LINK', 'UNLINK', 'LOCK', 'PROPFIND'],
+    UNSUPPORTED_METHODS_LIKE_GET = ['PURGE', 'UNLOCK', 'VIEW'],
+    isUnSupportedMethod = UNSUPPORTED_METHODS_LIKE_GET.includes(request.method) ||
+    UNSUPPORTED_METHODS_LIKE_POST.includes(request.method),
+    url = parseURL(request.url.toString()),
+    urlOrigin = url ? parseURL(request.url.toString()).origin : request.url.toString(),
+    urlPathAndHash = url ? request.url.toString().replace(urlOrigin, '') : '';
+
+  let snippet = makeOptionsSnippet(urlOrigin, options, indentString, request.toJSON().header);
+  snippet += 'var client = new RestClient(options);\n';
+  snippet += `var request = new RestRequest("${sanitize(urlPathAndHash)}", ` +
+  `${isUnSupportedMethod ? 'Method.Get' : ('Method.' + capitalizeFirstLetter(request.method))});\n`;
   if (request.body && request.body.mode === 'graphql' && !request.headers.has('Content-Type')) {
     request.addHeader({
       key: 'Content-Type',
@@ -38,17 +106,11 @@ function makeSnippet (request, options) {
   }
   snippet += parseRequest.parseHeader(request.toJSON(), options.trimRequestBody);
   if (request.body && request.body.mode === 'formdata') {
-    let isFile = false,
-      formdata = request.body.formdata,
+    let formdata = request.body.formdata,
       formdataArray = [];
-    request.body.toJSON().formdata.forEach((data) => {
-      if (!data.disabled && data.type === 'file') {
-        isFile = true;
-      }
-    });
     // The following statement needs to be added else the multipart/form-data request where there is no file
     // is being sent as x-www-form-urlencoded by default
-    if (!isFile) {
+    if (formdata.members.length > 0) {
       snippet += 'request.AlwaysMultipartFormData = true;\n';
     }
 
@@ -92,14 +154,14 @@ function makeSnippet (request, options) {
   }
   snippet += parseRequest.parseBody(request, options.trimRequestBody);
   if (isUnSupportedMethod) {
-    (UNSUPPORTED_METHODS_LIKE_GET.includes(request.method)) &&
-            (snippet += `IRestResponse response = client.ExecuteAsGet(request, "${request.method}");\n`);
-    (UNSUPPORTED_METHODS_LIKE_POST.includes(request.method)) &&
-            (snippet += `IRestResponse response = client.ExecuteAsPost(request, "${request.method}");\n`);
-  }
-  else {
-    snippet += 'IRestResponse response = client.Execute(request);\n';
+    snippet += 'request.OnBeforeRequest = (request) =>\n';
+    snippet += '{\n';
+    snippet += `${indentString}request.Method = new HttpMethod("${request.method}");\n`;
+    snippet += `${indentString}return default;\n`;
+    snippet += '};\n';
   }
+
+  snippet += 'RestResponse response = await client.ExecuteAsync(request);\n';
   snippet += 'Console.WriteLine(response.Content);';
 
   return snippet;
@@ -192,7 +254,8 @@ self = module.exports = {
       //  snippets to include C# class definition according to options
       headerSnippet = '',
       footerSnippet = '',
-
+      mainMethodSnippet = '',
+      importTask = '',
       //  snippet to create request in csharp-restsharp
       snippet = '';
 
@@ -202,15 +265,20 @@ self = module.exports = {
     indentString = indentString.repeat(options.indentCount);
 
     if (options.includeBoilerplate) {
+
+      mainMethodSnippet = indentString.repeat(2) + 'static async Task Main(string[] args) {\n';
+      importTask = 'using System.Threading;\nusing System.Threading.Tasks;\n';
+
       headerSnippet = 'using System;\n' +
                             'using RestSharp;\n' +
+                            importTask +
                             'namespace HelloWorldApplication {\n' +
                             indentString + 'class HelloWorld {\n' +
-                            indentString.repeat(2) + 'static void Main(string[] args) {\n';
+                            mainMethodSnippet;
       footerSnippet = indentString.repeat(2) + '}\n' + indentString + '}\n}\n';
     }
 
-    snippet = makeSnippet(request, options);
+    snippet = makeSnippet(request, options, indentString);
 
     //  if boilerplate is included then two more indentString needs to be added in snippet
     (options.includeBoilerplate) &&
diff --git a/codegens/http/lib/util.js b/codegens/http/lib/util.js
index faf6f49..3646cb7 100644
--- a/codegens/http/lib/util.js
+++ b/codegens/http/lib/util.js
@@ -213,11 +213,12 @@ function getBody (request, trimRequestBody) {
         return trimRequestBody ? requestBody.trim() : requestBody;
 
       case FORM_DATA:
-        requestBody += `${FORM_DATA_BOUNDARY}\n`;
+        requestBody += `--${FORM_DATA_BOUNDARY}\n`;
         /* istanbul ignore else */
         if (!_.isEmpty(request.body[request.body.mode])) {
-          let properties = getMembersOfPropertyList(request.body[request.body.mode]);
-          _.forEach(properties, function (property) {
+          let properties = getMembersOfPropertyList(request.body[request.body.mode]),
+            numberOfProperties = properties.length;
+          _.forEach(properties, function (property, index) {
             /* istanbul ignore else */
             if (property.type === 'text') {
               requestBody += 'Content-Disposition: form-data; name="';
@@ -242,7 +243,12 @@ function getBody (request, trimRequestBody) {
               }
               requestBody += '(data)\n';
             }
-            requestBody += `${FORM_DATA_BOUNDARY}\n`;
+            if (index === numberOfProperties - 1) {
+              requestBody += `--${FORM_DATA_BOUNDARY}--\n`;
+            }
+            else {
+              requestBody += `--${FORM_DATA_BOUNDARY}\n`;
+            }
           });
         }
         return trimRequestBody ? requestBody.trim() : requestBody;
diff --git a/codegens/nodejs-axios/lib/axios.js b/codegens/nodejs-axios/lib/axios.js
index b645fda..565e574 100644
--- a/codegens/nodejs-axios/lib/axios.js
+++ b/codegens/nodejs-axios/lib/axios.js
@@ -89,6 +89,7 @@ function makeSnippet (request, indentString, options) {
   snippet += dataSnippet + '\n';
 
   configArray.push(indentString + `method: '${request.method.toLowerCase()}'`);
+  configArray.push('maxBodyLength: Infinity');
   configArray.push(indentString + `url: '${sanitize(request.url.toString())}'`);
 
   headers = parseRequest.parseHeader(request, indentString);
diff --git a/npm/ci-requirements.sh b/npm/ci-requirements.sh
index 450ffb9..9b57f78 100755
--- a/npm/ci-requirements.sh
+++ b/npm/ci-requirements.sh
@@ -21,10 +21,10 @@ pushd ./codegens/csharp-restsharp &>/dev/null;
   sudo dpkg -i packages-microsoft-prod.deb
   sudo apt-get install apt-transport-https
   sudo apt-get update
-  sudo apt-get install dotnet-sdk-2.2
+  sudo apt-get install dotnet-sdk-6.0
   dotnet new console -o testProject
   pushd ./testProject &>/dev/null;
-  dotnet add package RestSharp --version 106.15.0
+  dotnet add package RestSharp
   popd &>/dev/null;
 popd &>/dev/null;
 
diff --git a/package-lock.json b/package-lock.json
index 91a1773..b0baca3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "postman-code-generators",
-  "version": "1.2.1",
+  "version": "1.3.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -433,12 +433,9 @@
       "dev": true
     },
     "async": {
-      "version": "2.6.3",
-      "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
-      "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
-      "requires": {
-        "lodash": "^4.17.14"
-      }
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/async/-/async-3.2.2.tgz",
+      "integrity": "sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g=="
     },
     "async-each": {
       "version": "1.0.3",
@@ -1509,19 +1506,46 @@
       "dev": true
     },
     "dependency-check": {
-      "version": "2.10.1",
-      "resolved": "https://registry.npmjs.org/dependency-check/-/dependency-check-2.10.1.tgz",
-      "integrity": "sha512-gmLQXELyRvWwy0IeSOMgqRvs5lotLhMO9n5932lfXhkyZ7i7wqAQ/zBoued07qRvgvo9Byol98sG8HbYKoTpNA==",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/dependency-check/-/dependency-check-3.0.0.tgz",
+      "integrity": "sha1-kuKkFBgS1OmcuRKYw2p0NbhIscY=",
       "dev": true,
       "requires": {
-        "async": "^2.1.4",
         "builtins": "^2.0.0",
-        "debug": "^2.2.0",
-        "detective": "^4.0.0",
-        "is-relative": "^0.2.1",
+        "debug": "^3.1.0",
+        "detective": "^5.0.2",
+        "is-relative": "^1.0.0",
         "minimist": "^1.2.0",
-        "read-package-json": "^1.3.3",
+        "read-package-json": "^2.0.10",
         "resolve": "^1.1.7"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "3.2.7",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+          "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+          "dev": true,
+          "requires": {
+            "ms": "^2.1.1"
+          }
+        },
+        "detective": {
+          "version": "5.2.0",
+          "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz",
+          "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==",
+          "dev": true,
+          "requires": {
+            "acorn-node": "^1.6.1",
+            "defined": "^1.0.0",
+            "minimist": "^1.1.1"
+          }
+        },
+        "ms": {
+          "version": "2.1.3",
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+          "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+          "dev": true
+        }
       }
     },
     "deps-sort": {
@@ -3001,18 +3025,6 @@
         "assert-plus": "^1.0.0"
       }
     },
-    "github-url-from-git": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.5.0.tgz",
-      "integrity": "sha1-+YX+3MCpqledyI16/waNVcxiUaA=",
-      "dev": true
-    },
-    "github-url-from-username-repo": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.2.tgz",
-      "integrity": "sha1-fdeTMNKr5pwQws73lxTJchV5Hfo=",
-      "dev": true
-    },
     "glob": {
       "version": "7.1.3",
       "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
@@ -3658,12 +3670,12 @@
       }
     },
     "is-relative": {
-      "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz",
-      "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=",
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
+      "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
       "dev": true,
       "requires": {
-        "is-unc-path": "^0.1.1"
+        "is-unc-path": "^1.0.0"
       }
     },
     "is-shared-array-buffer": {
@@ -3703,12 +3715,12 @@
       "dev": true
     },
     "is-unc-path": {
-      "version": "0.1.2",
-      "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz",
-      "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=",
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
+      "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
       "dev": true,
       "requires": {
-        "unc-path-regex": "^0.1.0"
+        "unc-path-regex": "^0.1.2"
       }
     },
     "is-weakref": {
@@ -3931,12 +3943,6 @@
         "handlebars": "^4.1.2"
       }
     },
-    "jju": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz",
-      "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=",
-      "dev": true
-    },
     "js-sha512": {
       "version": "0.8.0",
       "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz",
@@ -3944,9 +3950,9 @@
       "dev": true
     },
     "js-yaml": {
-      "version": "3.14.0",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
-      "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
+      "version": "3.14.1",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+      "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
       "dev": true,
       "requires": {
         "argparse": "^1.0.7",
@@ -4047,14 +4053,11 @@
       "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
       "dev": true
     },
-    "json-parse-helpfulerror": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz",
-      "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=",
-      "dev": true,
-      "requires": {
-        "jju": "^1.1.0"
-      }
+    "json-parse-even-better-errors": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
+      "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
+      "dev": true
     },
     "json-schema": {
       "version": "0.4.0",
@@ -4700,13 +4703,6 @@
         "to-regex": "^3.0.1"
       }
     },
-    "natives": {
-      "version": "1.1.6",
-      "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz",
-      "integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==",
-      "dev": true,
-      "optional": true
-    },
     "natural-compare": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
@@ -4935,6 +4931,12 @@
         "remove-trailing-separator": "^1.0.1"
       }
     },
+    "npm-normalize-package-bin": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
+      "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==",
+      "dev": true
+    },
     "npm-run-path": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
@@ -5981,57 +5983,15 @@
       }
     },
     "read-package-json": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-1.3.3.tgz",
-      "integrity": "sha1-73nf2kbhZTdu6KV++/7dTRsCm6Q=",
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz",
+      "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==",
       "dev": true,
       "requires": {
-        "glob": "^5.0.3",
-        "graceful-fs": "2 || 3",
-        "json-parse-helpfulerror": "^1.0.2",
-        "normalize-package-data": "^1.0.0"
-      },
-      "dependencies": {
-        "glob": {
-          "version": "5.0.15",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
-          "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
-          "dev": true,
-          "requires": {
-            "inflight": "^1.0.4",
-            "inherits": "2",
-            "minimatch": "2 || 3",
-            "once": "^1.3.0",
-            "path-is-absolute": "^1.0.0"
-          }
-        },
-        "graceful-fs": {
-          "version": "3.0.12",
-          "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.12.tgz",
-          "integrity": "sha512-J55gaCS4iTTJfTXIxSVw3EMQckcqkpdRv3IR7gu6sq0+tbC363Zx6KH/SEwXASK9JRbhyZmVjJEVJIOxYsB3Qg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "natives": "^1.1.3"
-          }
-        },
-        "normalize-package-data": {
-          "version": "1.0.3",
-          "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.3.tgz",
-          "integrity": "sha1-i+lVuJB6+XXxpFhOqLubQUkjEvU=",
-          "dev": true,
-          "requires": {
-            "github-url-from-git": "^1.3.0",
-            "github-url-from-username-repo": "^1.0.0",
-            "semver": "2 || 3 || 4"
-          }
-        },
-        "semver": {
-          "version": "4.3.6",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
-          "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=",
-          "dev": true
-        }
+        "glob": "^7.1.1",
+        "json-parse-even-better-errors": "^2.3.0",
+        "normalize-package-data": "^2.0.0",
+        "npm-normalize-package-bin": "^1.0.0"
       }
     },
     "read-pkg": {
@@ -6398,9 +6358,9 @@
       }
     },
     "shelljs": {
-      "version": "0.8.4",
-      "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
-      "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+      "version": "0.8.5",
+      "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz",
+      "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==",
       "requires": {
         "glob": "^7.0.0",
         "interpret": "^1.0.0",
diff --git a/package.json b/package.json
index 4d8c930..74918f7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "postman-code-generators",
-  "version": "1.2.1",
+  "version": "1.3.0",
   "description": "Generates code snippets for a postman collection",
   "main": "index.js",
   "directories": {
@@ -25,24 +25,24 @@
   "license": "Apache-2.0",
   "homepage": "https://github.com/postmanlabs/code-generators",
   "dependencies": {
-    "async": "2.6.3",
+    "async": "3.2.2",
     "path": "0.12.7",
     "postman-collection": "3.6.11",
-    "shelljs": "0.8.4"
+    "shelljs": "0.8.5"
   },
   "devDependencies": {
     "browserify": "14.5.0",
     "chai": "4.3.6",
     "chalk": "2.4.2",
     "eslint": "5.16.0",
-    "dependency-check": "2.10.1",
+    "dependency-check": "3.0.0",
     "editorconfig": "0.15.3",
     "eslint-plugin-jsdoc": "3.15.1",
     "eslint-plugin-lodash": "2.7.0",
     "eslint-plugin-mocha": "4.12.1",
     "eslint-plugin-security": "1.4.0",
     "istanbul": "0.4.5",
-    "js-yaml": "3.14.0",
+    "js-yaml": "3.14.1",
     "newman": "5.3.2",
     "jsdoc": "3.6.10",
     "mocha": "6.2.3",


Test patch:
diff --git a/codegens/csharp-restsharp/test/unit/convert.test.js b/codegens/csharp-restsharp/test/unit/convert.test.js
index dafd373..ca497f0 100644
--- a/codegens/csharp-restsharp/test/unit/convert.test.js
+++ b/codegens/csharp-restsharp/test/unit/convert.test.js
@@ -4,14 +4,15 @@ var expect = require('chai').expect,
   mainCollection = require('./fixtures/testcollection/collection.json'),
   testCollection = require('./fixtures/testcollection/collectionForEdge.json'),
   getOptions = require('../../lib/index').getOptions,
-  testResponse = require('./fixtures/testresponse.json'),
+  testResponseAsync = require('./fixtures/testResponseAsync.json'),
+  testResponseJsonParams = require('./fixtures/testResponseJsonParams.json'),
   sanitize = require('../../lib/util').sanitize,
   sanitizeOptions = require('../../lib/util').sanitizeOptions;
 
 describe('csharp restsharp function', function () {
 
   describe('csharp-restsharp convert function', function () {
-    it('should return expected snippet', function () {
+    it('should return expected snippet - Async', function () {
       var request = new sdk.Request(mainCollection.item[4].request),
         options = {
           indentCount: 1,
@@ -25,7 +26,25 @@ describe('csharp restsharp function', function () {
           expect.fail(null, null, error);
           return;
         }
-        expect(snippet).deep.equal(testResponse.result);
+        expect(snippet).deep.equal(testResponseAsync.result);
+      });
+    });
+
+    it('should return expected snippet json params', function () {
+      var request = new sdk.Request(mainCollection.item[5].request),
+        options = {
+          indentCount: 1,
+          indentType: 'Tab',
+          followRedirect: true,
+          trimRequestBody: true
+        };
+
+      convert(request, options, function (error, snippet) {
+        if (error) {
+          expect.fail(null, null, error);
+          return;
+        }
+        expect(snippet).deep.equal(testResponseJsonParams.result);
       });
     });
   });
@@ -45,7 +64,9 @@ describe('csharp restsharp function', function () {
           expect.fail(null, null, error);
           return;
         }
-        expect(snippet).to.include('using System;\nusing RestSharp;\nnamespace HelloWorldApplication {\n');
+        expect(snippet).to.include('using System;\nusing RestSharp;\nusing System.Threading;\nusing' +
+        ' System.Threading.Tasks;\nnamespace HelloWorldApplication {\n');
+        expect(snippet).to.include('static async Task Main(string[] args) {');
       });
     });
 
@@ -72,7 +93,7 @@ describe('csharp restsharp function', function () {
           expect.fail(null, null, error);
         }
         expect(snippet).to.be.a('string');
-        expect(snippet).to.include('client.Timeout = 5');
+        expect(snippet).to.include('MaxTimeout = 5');
       });
     });
 
@@ -82,7 +103,7 @@ describe('csharp restsharp function', function () {
           expect.fail(null, null, error);
         }
         expect(snippet).to.be.a('string');
-        expect(snippet).to.include('client.FollowRedirects = false');
+        expect(snippet).to.include('FollowRedirects = false');
       });
     });
 
@@ -165,7 +186,7 @@ describe('csharp restsharp function', function () {
 
     it('should use client.UserAgent instead of AddHeader function', function () {
       const sampleUA = 'Safari/605.1.15',
-        expectValue = `client.UserAgent = "${sampleUA}";`;
+        expectValue = `UserAgent = "${sampleUA}",`;
 
       var request = new sdk.Request({
         'method': 'GET',
@@ -192,6 +213,7 @@ describe('csharp restsharp function', function () {
         expect(snippet).to.include(expectValue);
       });
     });
+
   });
 
   describe('getOptions function', function () {
diff --git a/codegens/csharp-restsharp/test/unit/fixtures/testResponseAsync.json b/codegens/csharp-restsharp/test/unit/fixtures/testResponseAsync.json
new file mode 100644
index 0000000..4c51c6e
--- /dev/null
+++ b/codegens/csharp-restsharp/test/unit/fixtures/testResponseAsync.json
@@ -0,0 +1,3 @@
+{
+  "result" : "var options = new RestClientOptions(\"https://postman-echo.com\")\n{\n\tMaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"/post/?hardik=\\\"me\\\"\", Method.Post);\nrequest.AddHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\nrequest.AddParameter(\"1\", \"a\");\nrequest.AddParameter(\"2\", \"b\");\nrequest.AddParameter(\"\\\"\\\"12\\\"\\\"\", \"\\\"23\\\"\");\nrequest.AddParameter(\"'1\\\"2\\\\\\\"\\\"3'\", \"'1\\\"23\\\"4'\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
+}
diff --git a/codegens/csharp-restsharp/test/unit/fixtures/testResponseJsonParams.json b/codegens/csharp-restsharp/test/unit/fixtures/testResponseJsonParams.json
new file mode 100644
index 0000000..8ea7f16
--- /dev/null
+++ b/codegens/csharp-restsharp/test/unit/fixtures/testResponseJsonParams.json
@@ -0,0 +1,3 @@
+{
+  "result": "var options = new RestClientOptions(\"https://postman-echo.com\")\n{\n\tMaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"/post\", Method.Post);\nrequest.AddHeader(\"Content-Type\", \"application/json\");\nvar body = @\"{\" + \"\\n\" +\n@\"  \"\"json\"\": \"\"Test-Test\"\"\" + \"\\n\" +\n@\"}\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
+}
diff --git a/codegens/csharp-restsharp/test/unit/fixtures/testresponse.json b/codegens/csharp-restsharp/test/unit/fixtures/testresponse.json
deleted file mode 100644
index 1e71bd2..0000000
--- a/codegens/csharp-restsharp/test/unit/fixtures/testresponse.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "result": "var client = new RestClient(\"https://postman-echo.com/post/?hardik=\\\"me\\\"\");\nclient.Timeout = -1;\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\nrequest.AddParameter(\"1\", \"a\");\nrequest.AddParameter(\"2\", \"b\");\nrequest.AddParameter(\"\\\"\\\"12\\\"\\\"\", \"\\\"23\\\"\");\nrequest.AddParameter(\"'1\\\"2\\\\\\\"\\\"3'\", \"'1\\\"23\\\"4'\");\nIRestResponse response = client.Execute(request);\nConsole.WriteLine(response.Content);"
-}
\ No newline at end of file
diff --git a/codegens/dart-http/test/newman/newman.test.js b/codegens/dart-http/test/newman/newman.test.js
index 2b4e3e1..c137c04 100644
--- a/codegens/dart-http/test/newman/newman.test.js
+++ b/codegens/dart-http/test/newman/newman.test.js
@@ -9,7 +9,7 @@ describe('Convert for different types of request', function () {
       headerSnippet: '',
       // http uses Map<String, String> to store headers, so there is no way to
       // keep multiple headers with the same key
-      skipCollections: ['sameNameHeadersCollection']
+      skipCollections: ['sameNameHeadersCollection', 'unsupportedMethods']
     };
 
   runNewmanTest(convert, options, testConfig);
diff --git a/codegens/http/test/resources/expected-http-messages.json b/codegens/http/test/resources/expected-http-messages.json
index 38c8755..9090d36 100644
--- a/codegens/http/test/resources/expected-http-messages.json
+++ b/codegens/http/test/resources/expected-http-messages.json
@@ -4,7 +4,7 @@
     "GET /headers HTTP/1.1\nHost: postman-echo.com\nmy-sample-header: Lorem ipsum dolor sit amet\nTEST: @#$%^&*()\nmore: ,./';[]}{\":?><|\\\\",
     "GET /headers HTTP/1.1\nHost: postman-echo.com\nmy-sample-header: Lorem ipsum dolor sit amet\nnot-disabled-header: ENABLED",
     "GET /get?test=123&anotherone=232 HTTP/1.1\nHost: postman-echo.com",
-    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Length: 586\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pl\"\n\n'a'\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"qu\"\n\n\"b\"\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"hdjkljh\"\n\nc\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"sa\"\n\nd\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"Special\"\n\n!@#$%&*()^_+=`~    \n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"more\"\n\n,./';[]}{\":?><|\\\\\n----WebKitFormBoundary7MA4YWxkTrZu0gW\n",
+    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Length: 602\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pl\"\n\n'a'\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"qu\"\n\n\"b\"\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"hdjkljh\"\n\nc\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"sa\"\n\nd\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"Special\"\n\n!@#$%&*()^_+=`~    \n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"more\"\n\n,./';[]}{\":?><|\\\\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\n",
     "POST /post?a=!@$^*()_-`%26&b=,./';[]}{\":/?><|| HTTP/1.1\nHost: postman-echo.com",
     "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 284\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.!@#$%^&*()+POL:},'';,[;[;\n\n\n",
     "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 147\n\n1='a'&2=%22b%22&'3'=c&%224%22=d&Special=!%40%23%24%25%26*()%5E_%3D%60~%20%20%20%20&more=%2C.%2F'%3B%5B%5D%7D%7B%22%3A%3F%3E%3C%7C%5C%5C%20%20%20%20",
@@ -25,14 +25,14 @@
     "VIEW /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.",
     "PURGE / HTTP/1.1\nHost: 9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io",
     "COPY / HTTP/1.1\nHost: 9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io",
-    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Length: 174\n\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"file\"; filename=\"file.txt\"\nContent-Type: text/plain\n\n(data)\n----WebKitFormBoundary7MA4YWxkTrZu0gW\n",
+    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Length: 180\n\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"file\"; filename=\"file.txt\"\nContent-Type: text/plain\n\n(data)\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\n",
     "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 22\n\n\"<file contents here>\"",
     "GET / HTTP/1.1\nHost: localhost:5050",
     "GET /knockknock HTTP/1.1\nHost: localhost:5050"
   ],
   "trimmedResult": [
     "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 281\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.!@#$%^&*()+POL:},'';,[;[;",
-    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Length: 581\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pl\"\n\n'a'\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"qu\"\n\n\"b\"\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"hdjkljh\"\n\nc\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"sa\"\n\nd\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"Special\"\n\n!@#$%&*()^_+=`~\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"more\"\n\n,./';[]}{\":?><|\\\\\n----WebKitFormBoundary7MA4YWxkTrZu0gW",
+    "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Length: 597\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pl\"\n\n'a'\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"qu\"\n\n\"b\"\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"hdjkljh\"\n\nc\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"sa\"\n\nd\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"Special\"\n\n!@#$%&*()^_+=`~\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"more\"\n\n,./';[]}{\":?><|\\\\\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
     "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 123\n\n1='a'&2=%22b%22&'3'=c&%224%22=d&Special=!%40%23%24%25%26*()%5E_%3D%60~&more=%2C.%2F'%3B%5B%5D%7D%7B%22%3A%3F%3E%3C%7C%5C%5C"
   ]
 
diff --git a/codegens/java-unirest/test/newman/newman.test.js b/codegens/java-unirest/test/newman/newman.test.js
index adafad2..2eae22b 100644
--- a/codegens/java-unirest/test/newman/newman.test.js
+++ b/codegens/java-unirest/test/newman/newman.test.js
@@ -6,7 +6,7 @@ describe('Convert for different types of request', function () {
       runScript: 'java -cp *: main',
       compileScript: 'javac -cp *: main.java',
       fileName: 'main.java',
-      skipCollections: ['formdataCollection', 'emptyFormdataCollection']
+      skipCollections: ['formdataCollection', 'emptyFormdataCollection', 'unsupportedMethods']
     },
     options = {includeBoilerplate: true};
 
diff --git a/codegens/nodejs-axios/test/newman/newman.test.js b/codegens/nodejs-axios/test/newman/newman.test.js
index faa8cac..2771eea 100644
--- a/codegens/nodejs-axios/test/newman/newman.test.js
+++ b/codegens/nodejs-axios/test/newman/newman.test.js
@@ -7,7 +7,8 @@ describe('Convert for different types of request', function () {
       compileScript: null,
       runScript: 'node run.js',
       fileName: 'run.js',
-      headerSnippet: '/* eslint-disable */\n'
+      headerSnippet: '/* eslint-disable */\n',
+      skipCollections: ['unsupportedMethods']
     };
 
   runNewmanTest(convert, options, testConfig);
@@ -18,7 +19,8 @@ describe('Convert for different types of request', function () {
         compileScript: null,
         runScript: 'node run.js',
         fileName: 'run.js',
-        headerSnippet: '/* eslint-disable */\n'
+        headerSnippet: '/* eslint-disable */\n',
+        skipCollections: ['unsupportedMethods']
       };
 
     runNewmanTest(convert, options, testConfig);
diff --git a/codegens/nodejs-axios/test/unit/snippet.test.js b/codegens/nodejs-axios/test/unit/snippet.test.js
index 314c790..f09678f 100644
--- a/codegens/nodejs-axios/test/unit/snippet.test.js
+++ b/codegens/nodejs-axios/test/unit/snippet.test.js
@@ -424,6 +424,21 @@ describe('nodejs-axios convert function', function () {
       });
     });
 
+    it('should return snippet with maxBodyLength property as "Infinity"', function () {
+      request = new sdk.Request(mainCollection.item[0].request);
+      options = {
+        requestTimeout: 1000
+      };
+      convert(request, options, function (error, snippet) {
+        if (error) {
+          expect.fail(null, null, error);
+          return;
+        }
+        expect(snippet).to.be.a('string');
+        expect(snippet).to.include('maxBodyLength: Infinity');
+      });
+    });
+
     describe('getOptions function', function () {
 
       it('should return an array of specific options', function () {
diff --git a/codegens/nodejs-unirest/test/newman/newman.test.js b/codegens/nodejs-unirest/test/newman/newman.test.js
index 2e10a65..4dd1461 100644
--- a/codegens/nodejs-unirest/test/newman/newman.test.js
+++ b/codegens/nodejs-unirest/test/newman/newman.test.js
@@ -7,7 +7,8 @@ describe('Convert for different types of request', function () {
       compileScript: null,
       runScript: 'node run.js',
       fileName: 'run.js',
-      headerSnippet: '/* eslint-disable */\n'
+      headerSnippet: '/* eslint-disable */\n',
+      skipCollections: ['unsupportedMethods']
     };
 
   runNewmanTest(convert, options, testConfig);
@@ -18,7 +19,8 @@ describe('Convert for different types of request', function () {
         compileScript: null,
         runScript: 'node run.js',
         fileName: 'run.js',
-        headerSnippet: '/* eslint-disable */\n'
+        headerSnippet: '/* eslint-disable */\n',
+        skipCollections: ['unsupportedMethods']
       };
 
     runNewmanTest(convert, options, testConfig);
diff --git a/codegens/php-guzzle/test/newman/newman.test.js b/codegens/php-guzzle/test/newman/newman.test.js
index c1f8941..8304bdf 100644
--- a/codegens/php-guzzle/test/newman/newman.test.js
+++ b/codegens/php-guzzle/test/newman/newman.test.js
@@ -8,7 +8,8 @@ describe('PHP-Guzzle Converter', function () {
     var testConfig = {
         runScript: 'php codesnippet.php',
         fileName: 'codesnippet.php',
-        compileScript: null
+        compileScript: null,
+        skipCollections: ['unsupportedMethods']
       },
       options = {
         indentType: 'Space',
@@ -22,7 +23,8 @@ describe('PHP-Guzzle Converter', function () {
     var testConfig = {
         runScript: 'php codesnippet.php',
         fileName: 'codesnippet.php',
-        compileScript: null
+        compileScript: null,
+        skipCollections: ['unsupportedMethods']
       },
       options = {
         indentType: 'Space',
diff --git a/codegens/powershell-restmethod/test/newman/newman.test.js b/codegens/powershell-restmethod/test/newman/newman.test.js
index 77bf3a6..9482547 100644
--- a/codegens/powershell-restmethod/test/newman/newman.test.js
+++ b/codegens/powershell-restmethod/test/newman/newman.test.js
@@ -16,7 +16,7 @@ describe('Powershell Restmethod Converter', function () {
         // Poweshell does not support headers with duplicate keys
         // If a Post request has no body then powershell will still send
         // an empty string as body, which is not what is expected in newman tests
-        skipCollections: ['sameNameHeadersCollection', 'emptyFormdataCollection']
+        skipCollections: ['sameNameHeadersCollection', 'emptyFormdataCollection', 'unsupportedMethods']
       };
     runNewmanTest(convert, options, testConfig);
   });
diff --git a/codegens/python-http.client/test/newman/newman.test.js b/codegens/python-http.client/test/newman/newman.test.js
index f2f8132..d58bd67 100644
--- a/codegens/python-http.client/test/newman/newman.test.js
+++ b/codegens/python-http.client/test/newman/newman.test.js
@@ -13,7 +13,7 @@ describe('Convert for different types of request', function () {
     testConfig = {
       fileName: 'codesnippet.py',
       runScript: 'PYTHONIOENCODING=utf-8 python3 codesnippet.py',
-      skipCollections: ['redirectCollection', 'sameNameHeadersCollection']
+      skipCollections: ['redirectCollection', 'sameNameHeadersCollection', 'unsupportedMethods']
     };
   runNewmanTest(convert, options, testConfig);
 });
diff --git a/codegens/python-requests/test/newman/newman.test.js b/codegens/python-requests/test/newman/newman.test.js
index 42bc8de..6015b59 100644
--- a/codegens/python-requests/test/newman/newman.test.js
+++ b/codegens/python-requests/test/newman/newman.test.js
@@ -14,7 +14,7 @@ describe('Convert for different types of request', function () {
         // Requests does not support multipart/form-data unless we are also
         // uploading a file. Headers are stored in a dict so we cannot have
         // two headers with same key
-        skipCollections: ['formdataCollection', 'sameNameHeadersCollection']
+        skipCollections: ['formdataCollection', 'sameNameHeadersCollection', 'unsupportedMethods']
       };
     runNewmanTest(convert, options, testConfig);
   });
@@ -31,7 +31,7 @@ describe('Convert for different types of request', function () {
         // Requests does not support multipart/form-data unless we are also
         // uploading a file. Headers are stored in a dict so we cannot have
         // two headers with same key
-        skipCollections: ['formdataCollection', 'sameNameHeadersCollection']
+        skipCollections: ['formdataCollection', 'sameNameHeadersCollection', 'unsupportedMethods']
       };
     runNewmanTest(convert, options, testConfig);
 
diff --git a/codegens/r-httr/test/newman/newman.test.js b/codegens/r-httr/test/newman/newman.test.js
index a097cc4..67d9324 100644
--- a/codegens/r-httr/test/newman/newman.test.js
+++ b/codegens/r-httr/test/newman/newman.test.js
@@ -13,7 +13,7 @@ describe('r-httr Converter', function () {
         fileName: 'snippet.r',
         // Run script required to run the generated code snippet
         runScript: 'Rscript snippet.r',
-        skipCollections: ['redirectCollection']
+        skipCollections: ['redirectCollection', 'unsupportedMethods']
       };
     runNewmanTest(convert, options, testConfig);
   });
diff --git a/codegens/r-rcurl/test/newman/newman.test.js b/codegens/r-rcurl/test/newman/newman.test.js
index 4452cb2..f870061 100644
--- a/codegens/r-rcurl/test/newman/newman.test.js
+++ b/codegens/r-rcurl/test/newman/newman.test.js
@@ -7,7 +7,9 @@ describe('R-Rcurl Converter', function () {
     var testConfig = {
         runScript: 'Rscript codesnippet.r',
         fileName: 'codesnippet.r',
-        compileScript: null
+        compileScript: null,
+        skipCollections: ['unsupportedMethods']
+
       },
       options = {
         indentType: 'Space',
diff --git a/codegens/ruby/test/newman/newman.test.js b/codegens/ruby/test/newman/newman.test.js
index dce1098..cbb8c68 100644
--- a/codegens/ruby/test/newman/newman.test.js
+++ b/codegens/ruby/test/newman/newman.test.js
@@ -10,7 +10,7 @@ describe('Convert for different types of request', function () {
       fileName: 'codesnippet.rb',
       runScript: 'ruby codesnippet.rb',
       compileScript: null,
-      skipCollections: ['redirectCollection']
+      skipCollections: ['redirectCollection', 'unsupportedMethods']
     };
 
   runNewmanTest(convert, options, testConfig);
diff --git a/codegens/shell-wget/test/newman/newman.test.js b/codegens/shell-wget/test/newman/newman.test.js
index e10eb76..359425d 100644
--- a/codegens/shell-wget/test/newman/newman.test.js
+++ b/codegens/shell-wget/test/newman/newman.test.js
@@ -8,7 +8,8 @@ describe('Convert for different types of request', function () {
     },
     testConfig = {
       footerSnippet: ' -qO-', // Added this to get the response in stdout instead of saving in file.
-      skipCollections: ['formdataCollection', 'sameNameHeadersCollection', 'formdataFileCollection']
+      skipCollections: ['formdataCollection', 'sameNameHeadersCollection', 'formdataFileCollection',
+        'unsupportedMethods']
     };
   runNewmanTest(convert, options, testConfig);
 });
diff --git a/codegens/swift/test/newman/newman.test.js b/codegens/swift/test/newman/newman.test.js
index a8ef943..112d96d 100644
--- a/codegens/swift/test/newman/newman.test.js
+++ b/codegens/swift/test/newman/newman.test.js
@@ -10,7 +10,7 @@ describe.skip('Convert for different types of request', function () {
     testConfig = {
       fileName: 'snippet.swift',
       runScript: 'swift-5.3-RELEASE-ubuntu16.04/usr/bin/swift snippet.swift',
-      skipCollections: ['sameNameHeadersCollection']
+      skipCollections: ['sameNameHeadersCollection', 'unsupportedMethods']
     };
   runNewmanTest(convert, options, testConfig);
 });
diff --git a/test/codegen/newman/fixtures/unsupportedMethods.json b/test/codegen/newman/fixtures/unsupportedMethods.json
new file mode 100644
index 0000000..1b88db2
--- /dev/null
+++ b/test/codegen/newman/fixtures/unsupportedMethods.json
@@ -0,0 +1,294 @@
+{
+	"info": {
+		"name": "Code-Gen Test PHP Guzzle",
+		"_postman_id": "43058ce7-94da-0f0f-366e-22b77d566316",
+		"description": "This collection contains requests that will be used to test validity of plugin created to convert postman request into code snippet of particular language.",
+		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+	},
+	"item": [
+		{
+			"name": "LINK request",
+			"request": {
+				"method": "LINK",
+				"header": [
+					{
+						"key": "Content-Type",
+						"value": "text/plain"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat."
+				},
+				"url": {
+					"raw": "https://mockbin.org/request",
+					"protocol": "https",
+					"host": [
+						"mockbin",
+						"org"
+					],
+					"path": [
+						"request"
+					]
+				},
+				"description": null
+			},
+			"response": []
+		},
+		{
+			"name": "UNLINK request",
+			"request": {
+				"method": "UNLINK",
+				"header": [
+					{
+						"key": "Content-Type",
+						"value": "text/plain"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat."
+				},
+				"url": {
+					"raw": "https://mockbin.org/request",
+					"protocol": "https",
+					"host": [
+						"mockbin",
+						"org"
+					],
+					"path": [
+						"request"
+					]
+				},
+				"description": null
+			},
+			"response": []
+		},
+		{
+			"name": "LOCK request",
+			"request": {
+				"method": "LOCK",
+				"header": [
+					{
+						"key": "Content-Type",
+						"value": "text/plain"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat."
+				},
+				"url": {
+					"raw": "https://mockbin.org/request",
+					"protocol": "https",
+					"host": [
+						"mockbin",
+						"org"
+					],
+					"path": [
+						"request"
+					]
+				},
+				"description": null
+			},
+			"response": []
+		},
+		{
+			"name": "UNLOCK request",
+			"request": {
+				"method": "UNLOCK",
+				"header": [],
+				"body": {},
+				"url": {
+					"raw": "https://mockbin.org/request",
+					"protocol": "https",
+					"host": [
+						"mockbin",
+						"org"
+					],
+					"path": [
+						"request"
+					]
+				},
+				"description": null
+			},
+			"response": []
+		},
+		{
+			"name": "PROFIND request",
+			"request": {
+				"method": "PROPFIND",
+				"header": [
+					{
+						"key": "Content-Type",
+						"value": "text/plain"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat."
+				},
+				"url": {
+					"raw": "https://mockbin.org/request",
+					"protocol": "https",
+					"host": [
+						"mockbin",
+						"org"
+					],
+					"path": [
+						"request"
+					]
+				},
+				"description": null
+			},
+			"response": []
+		},
+		{
+			"name": "PURGE Request",
+			"request": {
+				"method": "PURGE",
+				"header": [],
+				"body": {},
+				"url": {
+					"raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io",
+					"protocol": "https",
+					"host": [
+						"9c76407d-5b8d-4b22-99fb-8c47a85d9848",
+						"mock",
+						"pstmn",
+						"io"
+					]
+				},
+				"description": ""
+			},
+			"response": []
+		},
+		{
+			"name": "COPY Request",
+			"request": {
+				"method": "COPY",
+				"header": [],
+				"body": {},
+				"url": {
+					"raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io",
+					"protocol": "https",
+					"host": [
+						"9c76407d-5b8d-4b22-99fb-8c47a85d9848",
+						"mock",
+						"pstmn",
+						"io"
+					]
+				},
+				"description": ""
+			},
+			"response": [
+				{
+					"id": "47494bfb-6d21-4f1f-ace0-f88e5e1ac05d",
+					"name": "COPY Request",
+					"originalRequest": {
+						"method": "COPY",
+						"header": [],
+						"body": {},
+						"url": {
+							"raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io",
+							"protocol": "https",
+							"host": [
+								"9c76407d-5b8d-4b22-99fb-8c47a85d9848",
+								"mock",
+								"pstmn",
+								"io"
+							]
+						}
+					},
+					"status": "OK",
+					"code": 200,
+					"_postman_previewlanguage": "json",
+					"_postman_previewtype": "text",
+					"header": [
+						{
+							"key": "Access-Control-Allow-Credentials",
+							"value": "",
+							"name": "Access-Control-Allow-Credentials",
+							"description": "Indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials."
+						},
+						{
+							"key": "Access-Control-Allow-Headers",
+							"value": "",
+							"name": "Access-Control-Allow-Headers",
+							"description": "Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request."
+						},
+						{
+							"key": "Access-Control-Allow-Methods",
+							"value": "",
+							"name": "Access-Control-Allow-Methods",
+							"description": "Specifies the method or methods allowed when accessing the resource. This is used in response to a preflight request."
+						},
+						{
+							"key": "Access-Control-Allow-Origin",
+							"value": "*",
+							"name": "Access-Control-Allow-Origin",
+							"description": "Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."
+						},
+						{
+							"key": "Access-Control-Expose-Headers",
+							"value": "",
+							"name": "Access-Control-Expose-Headers",
+							"description": "Lets a server whitelist headers that browsers are allowed to access."
+						},
+						{
+							"key": "Connection",
+							"value": "keep-alive",
+							"name": "Connection",
+							"description": "Options that are desired for the connection"
+						},
+						{
+							"key": "Content-Encoding",
+							"value": "gzip",
+							"name": "Content-Encoding",
+							"description": "The type of encoding used on the data."
+						},
+						{
+							"key": "Content-Length",
+							"value": "59",
+							"name": "Content-Length",
+							"description": "The length of the response body in octets (8-bit bytes)"
+						},
+						{
+							"key": "Content-Type",
+							"value": "application/json; charset=utf-8",
+							"name": "Content-Type",
+							"description": "The mime type of this content"
+						},
+						{
+							"key": "Date",
+							"value": "Mon, 05 Feb 2018 07:48:41 GMT",
+							"name": "Date",
+							"description": "The date and time that the message was sent"
+						},
+						{
+							"key": "ETag",
+							"value": "W/\"af-MmpVeTvfnSW88c4riXD0uw\"",
+							"name": "ETag",
+							"description": "An identifier for a specific version of a resource, often a message digest"
+						},
+						{
+							"key": "Server",
+							"value": "nginx",
+							"name": "Server",
+							"description": "A name for the server"
+						},
+						{
+							"key": "Vary",
+							"value": "Accept-Encoding",
+							"name": "Vary",
+							"description": "Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server."
+						}
+					],
+					"cookie": [],
+					"responseTime": 378,
+					"body": "{\n    \"status\": 200,\n    \"method\": \"COPY\"\n}"
+				}
+			]
+		}
+	]
+}