Skip to content

Commit fb6d0ba

Browse files
author
Ankit Saini
authored
Merge pull request #487 from postmanlabs/issue-486
Fix documentation for timeout setting in curl codegen
2 parents fb75a43 + a5542c6 commit fb6d0ba

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

codegens/curl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Convert function takes three parameters
1818
* `indentCount` - The number of indentation characters to add per code level
1919
* `trimRequestBody` - Trim request body fields
2020
* `followRedirect` - Boolean denoting whether to redirect a request
21-
* `requestTimeout` - Integer denoting time after which the request will bail out in milli-seconds
21+
* `requestTimeoutInSeconds` - Integer denoting time after which the request will bail out in seconds
2222
* `multiLine` - Boolean denoting whether to output code snippet with multi line breaks
2323
* `longFormat` - Boolean denoting whether to use longform cURL options in snippet
2424
* `quoteType` - String denoting the quote type to use (single or double) for URL

codegens/curl/lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ self = module.exports = {
1818
format, snippet, silent, url, quoteType;
1919

2020
redirect = options.followRedirect;
21-
timeout = options.requestTimeout;
21+
timeout = options.requestTimeoutInSeconds;
2222
multiLine = options.multiLine;
2323
format = options.longFormat;
2424
trim = options.trimRequestBody;
@@ -222,11 +222,11 @@ self = module.exports = {
222222
'(Use double quotes when running curl in cmd.exe and single quotes for the rest)'
223223
},
224224
{
225-
name: 'Set request timeout',
226-
id: 'requestTimeout',
225+
name: 'Set request timeout (in seconds)',
226+
id: 'requestTimeoutInSeconds',
227227
type: 'positiveInteger',
228228
default: 0,
229-
description: 'Set number of milliseconds the request should wait for a response before ' +
229+
description: 'Set number of seconds the request should wait for a response before ' +
230230
'timing out (use 0 for infinity)'
231231
},
232232
{

test/codegen/structure.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ const expectedOptions = {
4444
description: 'Set number of milliseconds the request should wait' +
4545
' for a response before timing out (use 0 for infinity)'
4646
},
47+
requestTimeoutInSeconds: {
48+
name: 'Set request timeout (in seconds)',
49+
type: 'positiveInteger',
50+
default: 0,
51+
description: 'Set number of seconds the request should wait' +
52+
' for a response before timing out (use 0 for infinity)'
53+
},
4754
followRedirect: {
4855
name: 'Follow redirects',
4956
type: 'boolean',
@@ -84,6 +91,7 @@ const expectedOptions = {
8491
'indentCount',
8592
'trimRequestBody',
8693
'requestTimeout',
94+
'requestTimeoutInSeconds',
8795
'silent',
8896
'includeBoilerplate',
8997
'followRedirect',

0 commit comments

Comments
 (0)