Skip to content

Commit 523684f

Browse files
committed
fix some missed options in different files
1 parent 3a98b20 commit 523684f

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

codegens/postman-cli/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,28 +129,6 @@ convert(request, {}, function(error, snippet) {
129129
});
130130
```
131131

132-
#### AWS Signature
133-
```js
134-
var request = new sdk.Request({
135-
url: 'https://s3.amazonaws.com/bucket/file',
136-
method: 'GET',
137-
auth: {
138-
type: 'awsv4',
139-
awsv4: [
140-
{ key: 'accessKey', value: 'AKIAIOSFODNN7EXAMPLE' },
141-
{ key: 'secretKey', value: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' },
142-
{ key: 'region', value: 'us-east-1' },
143-
{ key: 'service', value: 's3' }
144-
]
145-
}
146-
});
147-
148-
convert(request, {}, function(error, snippet) {
149-
console.log(snippet);
150-
// Output includes: --auth-aws-accessKey 'AKIAIOSFODNN7EXAMPLE' --auth-aws-secretKey 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' ...
151-
});
152-
```
153-
154132
### getOptions function
155133

156134
This function returns a list of options supported by this codegen.

codegens/postman-cli/lib/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var self = module.exports = {
3838
.replace(/!/g, '\\!');
3939
}
4040
else if (quoteType === '\'') {
41-
// for curl escaping of single quotes inside single quotes involves changing of ' to '\''
41+
// for shell escaping of single quotes inside single quotes involves changing of ' to '\''
4242
inputString = inputString.replace(/'/g, "'\\''"); // eslint-disable-line quotes
4343
}
4444

@@ -298,7 +298,7 @@ var self = module.exports = {
298298
* Determines if a request body is actually empty.
299299
* This is needed because body.isEmpty() returns false for formdata
300300
* and urlencoded when they contain only disabled params which will not
301-
* be a part of the curl request.
301+
* be a part of the CLI request.
302302
*/
303303
isBodyEmpty (body) {
304304
if (!body) {

codegens/postman-cli/npm-shrinkwrap.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codegens/postman-cli/test/ci-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -ev; # stop on error
33

44
echo "Installing dependencies required for tests in codegens/postman-cli"
55

6-
# Install curl if not already available
6+
# Install curl command-line tool (needed to download Postman CLI)
77
echo "Installing curl..."
88
sudo apt-get update
99
sudo apt-get install -y curl
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var runNewmanTest = require('../../../../test/codegen/newman/newmanTestUtil').runNewmanTest,
2+
convert = require('../../index').convert;
3+
4+
describe('Convert for different types of request', function () {
5+
var testConfig = {compileScript: null, runScript: null, fileName: null},
6+
options1 = {
7+
indentCount: 3,
8+
indentType: 'Space',
9+
requestTimeoutInSeconds: 200,
10+
multiLine: true,
11+
followRedirect: true,
12+
longFormat: true,
13+
quiet: true,
14+
lineContinuationCharacter: '\\',
15+
quoteType: 'single'
16+
},
17+
options2 = {
18+
indentCount: 3,
19+
indentType: 'Space',
20+
requestTimeoutInSeconds: 200,
21+
multiLine: true,
22+
followRedirect: true,
23+
longFormat: false,
24+
quiet: true,
25+
lineContinuationCharacter: '\\',
26+
quoteType: 'single'
27+
};
28+
29+
runNewmanTest(convert, options1, testConfig);
30+
runNewmanTest(convert, options2, testConfig);
31+
});
32+

0 commit comments

Comments
 (0)