Skip to content

Commit b92309f

Browse files
authored
Merge pull request #701 from postmanlabs/release/v1.7.2
Release version v1.7.2
2 parents 2e8e260 + 6168e6e commit b92309f

File tree

31 files changed

+774
-121
lines changed

31 files changed

+774
-121
lines changed
+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Draft new release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: The version you want to release. Must be a valid semver version.
8+
required: true
9+
type: string
10+
11+
jobs:
12+
draft-new-release:
13+
if: startsWith(github.event.inputs.version, 'v')
14+
name: Draft a new release
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Create release branch
25+
run: git checkout -b release/${{ github.event.inputs.version }}
26+
27+
- name: Update changelog
28+
uses: thomaseizinger/keep-a-changelog-new-release@1.1.0
29+
with:
30+
version: ${{ github.event.inputs.version }}
31+
32+
- name: Initialize mandatory git config
33+
run: |
34+
git config user.name "GitHub Actions"
35+
git config user.email noreply@github.com
36+
37+
- name: Bump version
38+
run: npm version ${{ github.event.inputs.version }} --git-tag-version false
39+
40+
- name: Commit changelog and manifest files
41+
id: make-commit
42+
run: |
43+
git add CHANGELOG.md package.json package-lock.json
44+
git commit --message "Prepare release ${{ github.event.inputs.version }}"
45+
echo "::set-output name=commit::$(git rev-parse HEAD)"
46+
47+
- name: Push new branch
48+
run: git push origin release/${{ github.event.inputs.version }}
49+
50+
- name: Create pull request for master
51+
uses: thomaseizinger/create-pull-request@1.0.0
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
head: release/${{ github.event.inputs.version }}
56+
base: master
57+
title: "Release version ${{ github.event.inputs.version }}"
58+
reviewers: ${{ github.actor }}
59+
body: |
60+
Hi @${{ github.actor }}!
61+
62+
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
63+
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
64+
65+
- name: Create pull request for develop
66+
uses: thomaseizinger/create-pull-request@1.0.0
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
head: release/${{ github.event.inputs.version }}
71+
base: develop
72+
title: "Release version ${{ github.event.inputs.version }}"
73+
reviewers: ${{ github.actor }}
74+
body: |
75+
Hi @${{ github.actor }}!
76+
77+
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
78+
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Publish new release"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
release:
12+
name: Publish new release
13+
runs-on: ubuntu-latest
14+
# only merged pull requests that begin with 'release/' or 'hotfix/' must trigger this job
15+
if: github.event.pull_request.merged == true &&
16+
(contains(github.event.pull_request.head.ref, 'release/') || contains(github.event.pull_request.head.ref, 'hotfix/'))
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: Extract version from branch name (for release branches)
22+
if: contains(github.event.pull_request.head.ref, 'release/')
23+
run: |
24+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
25+
VERSION=${BRANCH_NAME#release/}
26+
27+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
28+
29+
- name: Extract version from branch name (for hotfix branches)
30+
if: contains(github.event.pull_request.head.ref, 'hotfix/')
31+
run: |
32+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
33+
VERSION=${BRANCH_NAME#hotfix/}
34+
35+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
36+
37+
- name: Create Release
38+
uses: thomaseizinger/create-release@1.0.0
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
43+
tag_name: ${{ env.RELEASE_VERSION }}
44+
name: ${{ env.RELEASE_VERSION }}
45+
draft: false
46+
prerelease: false
File renamed without changes.

CHANGELOG.md

+105-65
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,143 @@
1-
v1.7.1 (March 29, 2023)
2-
* Minor fix - Add language labels for Rust and Kotlin
1+
# Postman Code Generators Changelog
2+
3+
## [Unreleased]
4+
5+
## [v1.7.2] - 2023-05-04
6+
7+
### Fixed
8+
9+
- Fix for - [#11934](https://github.com/postmanlabs/postman-app-support/issues/11934) Prevent `%` double encoding in query params
10+
11+
## [v1.7.1] - 2023-03-29
12+
13+
- Minor fix - Add language labels for Rust and Kotlin
14+
15+
## Previous Releases
16+
17+
Newer releases follow the [Keep a Changelog](https://keepachangelog.com) format.
318

419
v1.7.0 (March 28, 2023)
5-
* Fix for - [#192](https://github.com/postmanlabs/postman-code-generators/issues/192) Added support for Rust reqwest code snippets.
20+
21+
- Fix for - [#192](https://github.com/postmanlabs/postman-code-generators/issues/192) Added support for Rust reqwest code snippets.
622

723
v1.6.1 (March 27, 2023)
8-
* Fix backlashes being unescaped unnecessarily in cURL codegen
24+
25+
- Fix backlashes being unescaped unnecessarily in cURL codegen
926

1027
v1.6.0 (March 17, 2023)
11-
* PEP8 improvements in python-requests code
12-
* Fix for - [#491](https://github.com/postmanlabs/postman-code-generators/issues/491) Added support for kotlin okhttp code snippets.
13-
* Refactored code for nodejs-axios util.js.
28+
29+
- PEP8 improvements in python-requests code
30+
- Fix for - [#491](https://github.com/postmanlabs/postman-code-generators/issues/491) Added support for kotlin okhttp code snippets.
31+
- Refactored code for nodejs-axios util.js.
1432

1533
v1.5.1 (March 28, 2023)
16-
* Fix backlashes being escaped unnecessarily in cURL codegen
34+
35+
- Fix backlashes being escaped unnecessarily in cURL codegen
1736

1837
v1.5.0 (March 2, 2023)
19-
* Change minimum supported NodeJS version to 12
20-
* Fix for - [#11049](https://github.com/postmanlabs/postman-app-support/issues/11049) Escape backslash character in raw bodies for curl codegen
21-
* Fix for - [#302](https://github.com/postmanlabs/postman-code-generators/issues/302) Add option to use async/await in NodeJS Axios codegen
22-
* Fix for - [#322](https://github.com/postmanlabs/postman-code-generators/issues/322) Use multiline quotes in Powershell to simplify generated code
23-
* Add long form option for -g flag in curl codegen
24-
* Minor Swift codegen improvements
38+
39+
- Change minimum supported NodeJS version to 12
40+
- Fix for - [#11049](https://github.com/postmanlabs/postman-app-support/issues/11049) Escape backslash character in raw bodies for curl codegen
41+
- Fix for - [#302](https://github.com/postmanlabs/postman-code-generators/issues/302) Add option to use async/await in NodeJS Axios codegen
42+
- Fix for - [#322](https://github.com/postmanlabs/postman-code-generators/issues/322) Use multiline quotes in Powershell to simplify generated code
43+
- Add long form option for -g flag in curl codegen
44+
- Minor Swift codegen improvements
2545

2646
v1.4.1 (February 22, 2023)
27-
* cURL codegen should work when request has a protocolProfileBehavior with null value
47+
48+
- cURL codegen should work when request has a protocolProfileBehavior with null value
2849

2950
v1.4.0 (February 6, 2023)
30-
* Add support for C# HttpClient Codegen
31-
* Fix for - [#9511](https://github.com/postmanlabs/postman-app-support/issues/9511) - Use short options in CURL as long as possible
32-
* Fix for - [#10581](https://github.com/postmanlabs/postman-app-support/issues/10581) - Do not add HTTP method explicitly in CURL when not required
33-
* Fix for - [#10053](https://github.com/postmanlabs/postman-app-support/issues/10053) - Remove usage of semaphore from Swift Codegen
51+
52+
- Add support for C# HttpClient Codegen
53+
- Fix for - [#9511](https://github.com/postmanlabs/postman-app-support/issues/9511) - Use short options in CURL as long as possible
54+
- Fix for - [#10581](https://github.com/postmanlabs/postman-app-support/issues/10581) - Do not add HTTP method explicitly in CURL when not required
55+
- Fix for - [#10053](https://github.com/postmanlabs/postman-app-support/issues/10053) - Remove usage of semaphore from Swift Codegen
3456

3557
v1.3.0 (December 16, 2022)
36-
* Update C# restsharp codegen to support [107](https://restsharp.dev/v107/)
37-
* Fix for - [#11084](https://github.com/postmanlabs/postman-app-support/issues/11084) Fixes an issue where HTTP code snippet was generating wrong boundaries
38-
* Fixes an issue with Axios code snippets not including maxBodyLength param
58+
59+
- Update C# restsharp codegen to support [107](https://restsharp.dev/v107/)
60+
- Fix for - [#11084](https://github.com/postmanlabs/postman-app-support/issues/11084) Fixes an issue where HTTP code snippet was generating wrong boundaries
61+
- Fixes an issue with Axios code snippets not including maxBodyLength param
3962

4063
v1.2.1 (April 26, 2022)
41-
* Add label for 'R' language
64+
65+
- Add label for 'R' language
4266

4367
v1.2.0 (April 22, 2022)
44-
* Add new codegens - php-guzzle, R-httr, R-rcurl
45-
* Fix issue with pipeline failing due to updated version of RestSharp
46-
* Fix for - [#502](https://github.com/postmanlabs/postman-code-generators/issues/502) Allow GET method to have a body in java-okhttp if present in input request
47-
* Fix for - [#476](https://github.com/postmanlabs/postman-code-generators/pull/476) Properly escape already escaped double quotes in curl body
68+
69+
- Add new codegens - php-guzzle, R-httr, R-rcurl
70+
- Fix issue with pipeline failing due to updated version of RestSharp
71+
- Fix for - [#502](https://github.com/postmanlabs/postman-code-generators/issues/502) Allow GET method to have a body in java-okhttp if present in input request
72+
- Fix for - [#476](https://github.com/postmanlabs/postman-code-generators/pull/476) Properly escape already escaped double quotes in curl body
4873

4974
v1.1.5 (May 10, 2021)
50-
* Fixed an issue with how JSON bodies are shown in code snippets for Ruby, C#, and Dart.
75+
76+
- Fixed an issue with how JSON bodies are shown in code snippets for Ruby, C#, and Dart.
5177

5278
v1.1.4 (May 6, 2021)
53-
* Fix an issue with empty GraphQL body
79+
80+
- Fix an issue with empty GraphQL body
5481

5582
v1.1.3 (Mar 2, 2021)
56-
* Use proper indentation for JSON bodies in Javascript and Nodejs codegens
57-
* Fix for - [#445](https://github.com/postmanlabs/postman-code-generators/issues/445) Add proper indentation in nodejs-axios when bodytype is urlencoded
58-
* Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248) Use quoteType everywhere in curl, not just in the url
59-
* Fix for - [#454](https://github.com/postmanlabs/postman-code-generators/issues/454) Fix encoding when generating HTTP code snippets
60-
* Fix for - [#426](https://github.com/postmanlabs/postman-code-generators/issues/426) Use json.dumps in Python codegens if Content-Type is JSON
83+
84+
- Use proper indentation for JSON bodies in Javascript and Nodejs codegens
85+
- Fix for - [#445](https://github.com/postmanlabs/postman-code-generators/issues/445) Add proper indentation in nodejs-axios when bodytype is urlencoded
86+
- Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248) Use quoteType everywhere in curl, not just in the url
87+
- Fix for - [#454](https://github.com/postmanlabs/postman-code-generators/issues/454) Fix encoding when generating HTTP code snippets
88+
- Fix for - [#426](https://github.com/postmanlabs/postman-code-generators/issues/426) Use json.dumps in Python codegens if Content-Type is JSON
6189

6290
v1.1.2 (Dec 15, 2020)
63-
* Fix for - [#8736](https://github.com/postmanlabs/postman-app-support/issues/8736) Add content type support for individual form-data fields
64-
* Fix for - [#8635](https://github.com/postmanlabs/postman-app-support/issues/8635) Use Json.parse for all json like application types
65-
* Fix for - [#9212](https://github.com/postmanlabs/postman-app-support/issues/9212) Add semicolon after header key in curl codegen if the value is empty string.
66-
* Add Newman test for powershell
91+
92+
- Fix for - [#8736](https://github.com/postmanlabs/postman-app-support/issues/8736) Add content type support for individual form-data fields
93+
- Fix for - [#8635](https://github.com/postmanlabs/postman-app-support/issues/8635) Use Json.parse for all json like application types
94+
- Fix for - [#9212](https://github.com/postmanlabs/postman-app-support/issues/9212) Add semicolon after header key in curl codegen if the value is empty string.
95+
- Add Newman test for powershell
6796

6897
v1.1.1 (Nov 10, 2020)
69-
* Change string to enum in cURL quoteType option.
70-
* Fix new line issue in dart-http and HTTP codegen
71-
* Fix an issue where deepinstall was failing when folder name had spaces.
98+
99+
- Change string to enum in cURL quoteType option.
100+
- Fix new line issue in dart-http and HTTP codegen
101+
- Fix an issue where deepinstall was failing when folder name had spaces.
72102

73103
v1.1.0 (Nov 2, 2020)
74-
* Added support for Dart http
75-
* Fix for - [#315](https://github.com/postmanlabs/postman-code-generators/issues/315): Manually parse url provided in the request.
76-
* Fix for - [#253](https://github.com/postmanlabs/postman-code-generators/issues/253): Add -g flag to curl if braces ({}) or brackets ([#]) are present in the url.
77-
* Fix for - [#257](https://github.com/postmanlabs/postman-code-generators/issues/257): Use double quotes to escape semicolon in curl requests
78-
* Fix for - [#247](https://github.com/postmanlabs/postman-code-generators/issues/247): Add ContentType to python snippets for multipart/formdata
79-
* Fix for - [#186](https://github.com/postmanlabs/postman-code-generators/issues/186): Add ` as line continuation delimiter for curl codegen
80-
* Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248): Add quoteType as an additional option in curl codegen
81-
* Fix deadlock in error case in Swift and Objective-C codegens.
82-
* Fix for - [#325](https://github.com/postmanlabs/postman-code-generators/issues/325): Use encodeURIComponent instead of escape for urlencoded request body.
83-
* Fix for - [#350](https://github.com/postmanlabs/postman-code-generators/issues/350): Sanitize \r in request body.
84-
* Fix for - [#366](https://github.com/postmanlabs/postman-code-generators/issues/366): Add support for uploading binary files for multipart/form-data bodies in python-http.client.
85-
* Fix for - [#353](https://github.com/postmanlabs/postman-code-generators/issues/353): Add optional import of FoundationNetworking in swift codegen
86-
* Fix for - [#284](https://github.com/postmanlabs/postman-code-generators/issues/284): Replace double-quotes by single-quotes in codegen/php-curl
87-
* Fix for - [#330](https://github.com/postmanlabs/postman-code-generators/issues/330): Use url.toString method for converting url in shell-httpie codegen
104+
105+
- Added support for Dart http
106+
- Fix for - [#315](https://github.com/postmanlabs/postman-code-generators/issues/315): Manually parse url provided in the request.
107+
- Fix for - [#253](https://github.com/postmanlabs/postman-code-generators/issues/253): Add -g flag to curl if braces ({}) or brackets ([#]) are present in the url.
108+
- Fix for - [#257](https://github.com/postmanlabs/postman-code-generators/issues/257): Use double quotes to escape semicolon in curl requests
109+
- Fix for - [#247](https://github.com/postmanlabs/postman-code-generators/issues/247): Add ContentType to python snippets for multipart/formdata
110+
- Fix for - [#186](https://github.com/postmanlabs/postman-code-generators/issues/186): Add \` as line continuation delimiter for curl codegen
111+
- Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248): Add quoteType as an additional option in curl codegen
112+
- Fix deadlock in error case in Swift and Objective-C codegens.
113+
- Fix for - [#325](https://github.com/postmanlabs/postman-code-generators/issues/325): Use encodeURIComponent instead of escape for urlencoded request body.
114+
- Fix for - [#350](https://github.com/postmanlabs/postman-code-generators/issues/350): Sanitize \\r in request body.
115+
- Fix for - [#366](https://github.com/postmanlabs/postman-code-generators/issues/366): Add support for uploading binary files for multipart/form-data bodies in python-http.client.
116+
- Fix for - [#353](https://github.com/postmanlabs/postman-code-generators/issues/353): Add optional import of FoundationNetworking in swift codegen
117+
- Fix for - [#284](https://github.com/postmanlabs/postman-code-generators/issues/284): Replace double-quotes by single-quotes in codegen/php-curl
118+
- Fix for - [#330](https://github.com/postmanlabs/postman-code-generators/issues/330): Use url.toString method for converting url in shell-httpie codegen
88119

89120
v1.0.2 (Oct 15, 2020)
90-
* Fixed spaces around variables and arguments in Python codgen to comply with PEP 8.
91-
* Added Content-Length header to generated HTTP snippets.
92-
* Switched to multiline strings for Raw bodies in Go.
93-
* Stopped manually encoding response bodes in `utf8` for Python-requests.
94-
* Removed unnecessary semicolons at the end of statements in Ruby.
95-
* Fixed wrong name of HTTP codegen in README
121+
122+
- Fixed spaces around variables and arguments in Python codgen to comply with PEP 8.
123+
- Added Content-Length header to generated HTTP snippets.
124+
- Switched to multiline strings for Raw bodies in Go.
125+
- Stopped manually encoding response bodes in `utf8` for Python-requests.
126+
- Removed unnecessary semicolons at the end of statements in Ruby.
127+
- Fixed wrong name of HTTP codegen in README
96128

97129
v1.0.1 (Jun 29, 2020)
98-
- Fix for - [#8674](https://github.com/postmanlabs/postman-app-support/issues/8674): Add URL sanitization for quotes in cURL, Java Unirest, NodeJS Native, Python http.client, and Swift.
130+
131+
- Fix for - [#8674](https://github.com/postmanlabs/postman-app-support/issues/8674): Add URL sanitization for quotes in cURL, Java Unirest, NodeJS Native, Python http.client, and Swift.
99132

100133
v1.0.0 (May 29, 2020)
101-
- Add axios framework support
102-
- Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
103-
- Fix snippet generation for powershell and jquery, where form data params had no type field
134+
135+
- Add axios framework support
136+
- Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
137+
- Fix snippet generation for powershell and jquery, where form data params had no type field
138+
139+
[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.2...HEAD
140+
141+
[v1.7.2]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.1...v1.7.2
142+
143+
[v1.7.1]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.0...v1.7.1

codegens/curl/lib/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ var self = module.exports = {
207207
},
208208

209209
/**
210-
* Encode param except the following characters- [,{,},]
210+
* Encode param except the following characters- [,{,},],%
211211
*
212212
* @param {String} param
213213
* @returns {String}
@@ -218,6 +218,7 @@ var self = module.exports = {
218218
.replace(/%7B/g, '{')
219219
.replace(/%5D/g, ']')
220220
.replace(/%7D/g, '}')
221+
.replace(/%25/g, '%')
221222
.replace(/'/g, '%27');
222223
},
223224

codegens/curl/test/unit/convert.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,13 @@ describe('curl convert function', function () {
650650
expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b%20c%27');
651651
});
652652

653+
it('should not encode query params that are already encoded', function () {
654+
rawUrl = 'https://postman-echo.com/get?query=urn%3Ali%3Afoo%3A62324';
655+
urlObject = new sdk.Url(rawUrl);
656+
outputUrlString = getUrlStringfromUrlObject(urlObject);
657+
expect(outputUrlString).to.equal('https://postman-echo.com/get?query=urn%3Ali%3Afoo%3A62324');
658+
});
659+
653660
it('should discard disabled query params', function () {
654661
urlObject = new sdk.Url({
655662
protocol: 'https',

0 commit comments

Comments
 (0)