diff --git a/codegens/curl/README.md b/codegens/curl/README.md index c52d53451..a9962c100 100644 --- a/codegens/curl/README.md +++ b/codegens/curl/README.md @@ -18,7 +18,7 @@ Convert function takes three parameters * `indentCount` - The number of indentation characters to add per code level * `trimRequestBody` - Trim request body fields * `followRedirect` - Boolean denoting whether to redirect a request - * `requestTimeout` - Integer denoting time after which the request will bail out in milli-seconds + * `requestTimeoutInSeconds` - Integer denoting time after which the request will bail out in seconds * `multiLine` - Boolean denoting whether to output code snippet with multi line breaks * `longFormat` - Boolean denoting whether to use longform cURL options in snippet * `quoteType` - String denoting the quote type to use (single or double) for URL diff --git a/codegens/curl/lib/index.js b/codegens/curl/lib/index.js index 268815365..253ffedc8 100644 --- a/codegens/curl/lib/index.js +++ b/codegens/curl/lib/index.js @@ -18,7 +18,7 @@ self = module.exports = { format, snippet, silent, url, quoteType; redirect = options.followRedirect; - timeout = options.requestTimeout; + timeout = options.requestTimeoutInSeconds; multiLine = options.multiLine; format = options.longFormat; trim = options.trimRequestBody; @@ -222,11 +222,11 @@ self = module.exports = { '(Use double quotes when running curl in cmd.exe and single quotes for the rest)' }, { - name: 'Set request timeout', - id: 'requestTimeout', + name: 'Set request timeout (in seconds)', + id: 'requestTimeoutInSeconds', type: 'positiveInteger', default: 0, - description: 'Set number of milliseconds the request should wait for a response before ' + + description: 'Set number of seconds the request should wait for a response before ' + 'timing out (use 0 for infinity)' }, { diff --git a/test/codegen/structure.test.js b/test/codegen/structure.test.js index 7fbdf0b4d..a70d9629a 100644 --- a/test/codegen/structure.test.js +++ b/test/codegen/structure.test.js @@ -44,6 +44,13 @@ const expectedOptions = { description: 'Set number of milliseconds the request should wait' + ' for a response before timing out (use 0 for infinity)' }, + requestTimeoutInSeconds: { + name: 'Set request timeout (in seconds)', + type: 'positiveInteger', + default: 0, + description: 'Set number of seconds the request should wait' + + ' for a response before timing out (use 0 for infinity)' + }, followRedirect: { name: 'Follow redirects', type: 'boolean', @@ -84,6 +91,7 @@ const expectedOptions = { 'indentCount', 'trimRequestBody', 'requestTimeout', + 'requestTimeoutInSeconds', 'silent', 'includeBoilerplate', 'followRedirect',