-
Notifications
You must be signed in to change notification settings - Fork 360
Adds additional option to curl codegen #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Adds quoteType option to getOption function - Adds quoteType option to README in available options - Adds quoteType in example snippet in README - sets the url quote to one provided in options, if not provided default will be used
- adds quoteType option to structure - adds unit test for single quote quoteType - adds unit test for double quote quoteType
codegens/curl/README.md
Outdated
@@ -34,7 +35,8 @@ var request = new sdk.Request('www.google.com'), //using postman sdk to create | |||
trimRequestBody: true, | |||
multiLine: true, | |||
followRedirect: true, | |||
longFormat: true | |||
longFormat: true, | |||
quoteType: '\'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the quoteType option here should be singlequote
or doublequote
. This can be translated to '
or "
inside the module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
codegens/curl/lib/index.js
Outdated
availableOptions: ['\'', '"'], | ||
type: 'enum', | ||
default: '\'', | ||
description: 'Set a Quote type to be used(Single or Double) to be used,' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This copy needs to be looked at. I'd suggest using https://www.grammarly.com/ to proofread any copy. Also, does this need to be different from what's mentioned in the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this
expect(snippetArray[4][0]).to.equal('\''); | ||
}); | ||
}); | ||
it('should return snippet with url in double quote(") as line continuation ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the quote have to do with the line-continuation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah its a typo nothing much. Will fix it
codegens/curl/lib/index.js
Outdated
{ | ||
name: 'Quote Type', | ||
id: 'quoteType', | ||
availableOptions: ['\'', '"'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
availableOptions should be ['single quote', 'double quote'] as mentioned by @abhijitkane above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
…generators into fix/quoteOption pulls ci fixes and nodejs-axios codegen
- Changes quoteType values to single/double instead of '/" - Changes quoteType option values in newman/unit test - fixes typos in curl/README - Changes example in curl/README for new option values - Changes description of quoteType option where necessary
- removes .encode(utf8) from print statement in generated snippet
@shreys7 @umeshp7 we have request for three variations of curl command, one we have option for setting line breaker, now this one ^ for quotes and in this #186 requesting changes for curl to run in powershell. Can we just have one option as "OS" or "shell type" ?? that would be much easier operate rather than having 3 different options which is anyway not gonna be used in all permutations ? |
- Adds Content-Length header to HTTP snippets when body type is raw and length is nonzero - Modifies expected response and adds Content-Length header where required - adds test to check Content-length header for above case
- removes check for only raw body requests - calculates Content length for all type of body - appends adds content length header if body has nonzero length - adds newline character before form data header for proper formatting - modifies expected-http-message json and adds content length header where required - modifies name for unit test for content-length header
- adds err check after client.Do(req) - adds println and return statement inside err condition body
- removes json.stringify where not necessary - sanitize raw body
Add sanitising of quotes in URLs(and paths)
…78a8b30629edb53406ba1983ef84 [Snyk] Upgrade async from 2.5.0 to 2.6.3
Snyk has created this PR to upgrade recursive-readdir from 2.1.0 to 2.2.2. See this package in npm: https://www.npmjs.com/package/recursive-readdir See this project in Snyk: https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e?utm_source=github&utm_medium=upgrade-pr
…0fa465c617f53cf4d8262a8ed036 [Snyk] Upgrade recursive-readdir from 2.1.0 to 2.2.2
Snyk has created this PR to upgrade postman-collection from 3.5.1 to 3.6.7. See this package in npm: https://www.npmjs.com/package/postman-collection See this project in Snyk: https://app.snyk.io/org/postman/project/8519ba8e-6a7d-469a-88b3-7891b4c1c14e?utm_source=github&utm_medium=upgrade-pr
…2dd5f2f2dce2664e45db20117c85 [Snyk] Upgrade postman-collection from 3.5.1 to 3.6.7
Replace double-quotes by single-quotes in codegen/php-curl
Add optional import of FoundationNetworking in swift codegen to make it work with Swift 5.x
Add support for uploading binary files for multipart/form-data bodies in python-http.client.
…bce7deae81d5476f66de2cd0 [Snyk] Security upgrade eslint from 4.18.2 to 5.0.0
Fix package-lock.json
…1db6068aea5e16112f16b526 [Snyk] Security upgrade newman from 4.5.7 to 5.2.0
Run tests for both Python 2 and Python 3 for python-requests
…77e4b620656d9805f89af5577d76 [Snyk] Upgrade postman-collection from 3.5.1 to 3.6.7
@webholik Has many conflicts |
Bungled it up. New PR at #398. |
Fixes #248
Alternative to #92
Adds
quoteType
option to curl codegen.Since windows does not accept single quoted url parameter, this option allows to set it to double quote.
While adding the url to the snippet instead of hardcoding the quote
'
I have used this option to set the quote as per requirements. I haven't added the option paramere for all occurrence ofquote
. Added just for the url parameter.