Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codegens/curl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions codegens/curl/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)'
},
{
Expand Down
8 changes: 8 additions & 0 deletions test/codegen/structure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -84,6 +91,7 @@ const expectedOptions = {
'indentCount',
'trimRequestBody',
'requestTimeout',
'requestTimeoutInSeconds',
'silent',
'includeBoilerplate',
'followRedirect',
Expand Down