Skip to content

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

Closed
wants to merge 140 commits into from

Conversation

someshkoli
Copy link
Contributor

@someshkoli someshkoli commented May 17, 2020

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 of quote. Added just for the url parameter.

vinibrsl and others added 5 commits April 27, 2020 16:06
 - 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
@@ -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: '\''
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

availableOptions: ['\'', '"'],
type: 'enum',
default: '\'',
description: 'Set a Quote type to be used(Single or Double) to be used,' +
Copy link
Member

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?

Copy link
Contributor Author

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 ' +
Copy link
Member

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?

Copy link
Contributor Author

@someshkoli someshkoli May 27, 2020

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

{
name: 'Quote Type',
id: 'quoteType',
availableOptions: ['\'', '"'],
Copy link
Contributor

@umeshp7 umeshp7 May 27, 2020

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

 - 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
@someshkoli
Copy link
Contributor Author

someshkoli commented May 28, 2020

@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 ?

someshkoli and others added 4 commits May 29, 2020 06:09
 - 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
webholik and others added 23 commits October 16, 2020 15:15
…78a8b30629edb53406ba1983ef84

[Snyk] Upgrade async from 2.5.0 to 2.6.3
…0fa465c617f53cf4d8262a8ed036

[Snyk] Upgrade recursive-readdir from 2.1.0 to 2.2.2
…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
@umeshp7
Copy link
Contributor

umeshp7 commented Oct 28, 2020

@webholik Has many conflicts

@webholik
Copy link
Contributor

Bungled it up. New PR at #398.

@webholik webholik closed this Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cURL snippets fail on Windows due to Single Quote