Skip to content

Commit ed0b8f8

Browse files
committed
Merge branch 'release/4.6.0'
2 parents a23040f + 7795cd8 commit ed0b8f8

File tree

13 files changed

+453
-14
lines changed

13 files changed

+453
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# OpenAPI-Postman Changelog
22

3+
#### v4.6.0 (December 30, 2022)
4+
* Fixed issue where bundling of multi-file definition was not working correctly for more than 10 params correctly.
5+
* Fixed issue where request name was not using operation description if available.
6+
37
#### v4.5.0 (December 23, 2022)
48
* Fixed issue [#11519](https://github.com/postmanlabs/postman-app-support/issues/11519) Collection generated from imported OpenAPI were missing certain properties.
59
* Fixed issue [#11227](https://github.com/postmanlabs/postman-app-support/issues/11227) Collection generated produces incorrect XML requests and responses from Open API 3.0 and Swagger 2.0 API definitions.

OPTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id|type|available options|default|description|usage
22
|---|---|---|---|---|---|
3-
requestNameSource|enum|URL, Fallback|Fallback|Determines how the requests inside the generated collection will be named. If “Fallback” is selected, the request will be named after one of the following schema values: `description`, `operationid`, `url`.|CONVERSION, VALIDATION
3+
requestNameSource|enum|URL, Fallback|Fallback|Determines how the requests inside the generated collection will be named. If “Fallback” is selected, the request will be named after one of the following schema values: `summary`, `operationId`, `description`, `url`.|CONVERSION, VALIDATION
44
indentCharacter|enum|Space, Tab|Space|Option for setting indentation character|CONVERSION
55
collapseFolders|boolean|-|true|Importing will collapse all folders that have only one child element and lack persistent folder-level data.|CONVERSION
66
optimizeConversion|boolean|-|true|Optimizes conversion for large specification, disabling this option might affect the performance of conversion.|CONVERSION

lib/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function createComponentMainKey(tempRef, mainKeys) {
237237
*/
238238
function getTraceFromParentKeyInComponents(nodeContext, tempRef, mainKeys, version, commonPathFromData) {
239239
const parents = [...nodeContext.parents].reverse(),
240-
isArrayKeyRegexp = new RegExp('^\\d$', 'g'),
240+
isArrayKeyRegexp = new RegExp('^\\d+$', 'g'),
241241
key = nodeContext.key,
242242
keyIsAnArrayItem = key.match(isArrayKeyRegexp),
243243
parentKeys = [...parents.map((parent) => {

lib/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = {
6464
availableOptions: ['URL', 'Fallback'],
6565
description: 'Determines how the requests inside the generated collection will be named.' +
6666
' If “Fallback” is selected, the request will be named after one of the following schema' +
67-
' values: `description`, `operationid`, `url`.',
67+
' values: `summary`, `operationId`, `description`, `url`.',
6868
external: true,
6969
usage: ['CONVERSION', 'VALIDATION'],
7070
supportedIn: [VERSION20, VERSION30, VERSION31]

lib/schemaUtils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,13 +2534,15 @@ module.exports = {
25342534
case 'fallback' : {
25352535
// operationId is usually camelcase or snake case
25362536
if (fromWebhooks) {
2537-
reqName = utils.insertSpacesInName(operation.operationId) ||
2538-
operation.summary ||
2537+
reqName = operation.summary ||
2538+
utils.insertSpacesInName(operation.operationId) ||
25392539
operation.description ||
25402540
`${this.cleanWebhookName(operationItem.path)} - ${operationItem.method}`;
25412541
}
25422542
else {
2543-
reqName = operation.summary || utils.insertSpacesInName(operation.operationId) || reqUrl;
2543+
reqName = operation.summary ||
2544+
utils.insertSpacesInName(operation.operationId) ||
2545+
operation.description || reqUrl;
25442546
}
25452547
break;
25462548
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openapi-to-postmanv2",
3-
"version": "4.5.0",
3+
"version": "4.6.0",
44
"description": "Convert a given OpenAPI specification to Postman Collection v2.0",
55
"homepage": "https://github.com/postmanlabs/openapi-to-postman",
66
"bugs": "https://github.com/postmanlabs/openapi-to-postman/issues",
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
{
2+
"openapi": "3.0.2",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "Swagger Petstore",
6+
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
7+
"termsOfService": "http://swagger.io/terms/",
8+
"contact": {
9+
"name": "Swagger API Team",
10+
"email": "apiteam@swagger.io",
11+
"url": "http://swagger.io"
12+
},
13+
"license": {
14+
"name": "Apache 2.0",
15+
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
16+
}
17+
},
18+
"paths": {
19+
"/pets": {
20+
"get": {
21+
"description": "Returns all pets alesuada ac...",
22+
"operationId": "findPets",
23+
"parameters": [
24+
{
25+
"$ref": "#/components/parameters/_parameters.yaml-param1"
26+
},
27+
{
28+
"$ref": "#/components/parameters/_parameters.yaml-param2"
29+
},
30+
{
31+
"$ref": "#/components/parameters/_parameters.yaml-param3"
32+
},
33+
{
34+
"$ref": "#/components/parameters/_parameters.yaml-param4"
35+
},
36+
{
37+
"$ref": "#/components/parameters/_parameters.yaml-param5"
38+
},
39+
{
40+
"$ref": "#/components/parameters/_parameters.yaml-param6"
41+
},
42+
{
43+
"$ref": "#/components/parameters/_parameters.yaml-param7"
44+
},
45+
{
46+
"$ref": "#/components/parameters/_parameters.yaml-param8"
47+
},
48+
{
49+
"$ref": "#/components/parameters/_parameters.yaml-param9"
50+
},
51+
{
52+
"$ref": "#/components/parameters/_parameters.yaml-param10"
53+
},
54+
{
55+
"$ref": "#/components/parameters/_parameters.yaml-param11"
56+
},
57+
{
58+
"$ref": "#/components/parameters/_parameters.yaml-param12"
59+
}
60+
],
61+
"responses": {
62+
"200": {
63+
"description": "pet response",
64+
"schema": {
65+
"type": "array",
66+
"items": {
67+
"$ref": "#/components/schemas/Pet"
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}
74+
},
75+
"components": {
76+
"schemas": {
77+
"Pet": {
78+
"required": [
79+
"id",
80+
"name"
81+
],
82+
"properties": {
83+
"id": {
84+
"type": "integer",
85+
"format": "int64"
86+
},
87+
"name": {
88+
"type": "string"
89+
},
90+
"tag": {
91+
"type": "string"
92+
}
93+
}
94+
}
95+
},
96+
"parameters": {
97+
"_parameters.yaml-param1": {
98+
"name": "tags1",
99+
"in": "query",
100+
"description": "tags to filter by",
101+
"required": false,
102+
"type": "array",
103+
"collectionFormat": "csv",
104+
"items": {
105+
"type": "string"
106+
}
107+
},
108+
"_parameters.yaml-param2": {
109+
"name": "tags2",
110+
"in": "query",
111+
"description": "tags to filter by",
112+
"required": false,
113+
"type": "array",
114+
"collectionFormat": "csv",
115+
"items": {
116+
"type": "string"
117+
}
118+
},
119+
"_parameters.yaml-param3": {
120+
"name": "tags3",
121+
"in": "query",
122+
"description": "tags to filter by",
123+
"required": false,
124+
"type": "array",
125+
"collectionFormat": "csv",
126+
"items": {
127+
"type": "string"
128+
}
129+
},
130+
"_parameters.yaml-param4": {
131+
"name": "tags4",
132+
"in": "query",
133+
"description": "tags to filter by",
134+
"required": false,
135+
"type": "array",
136+
"collectionFormat": "csv",
137+
"items": {
138+
"type": "string"
139+
}
140+
},
141+
"_parameters.yaml-param5": {
142+
"name": "tags5",
143+
"in": "query",
144+
"description": "tags to filter by",
145+
"required": false,
146+
"type": "array",
147+
"collectionFormat": "csv",
148+
"items": {
149+
"type": "string"
150+
}
151+
},
152+
"_parameters.yaml-param6": {
153+
"name": "tags6",
154+
"in": "query",
155+
"description": "tags to filter by",
156+
"required": false,
157+
"type": "array",
158+
"collectionFormat": "csv",
159+
"items": {
160+
"type": "string"
161+
}
162+
},
163+
"_parameters.yaml-param7": {
164+
"name": "tags7",
165+
"in": "query",
166+
"description": "tags to filter by",
167+
"required": false,
168+
"type": "array",
169+
"collectionFormat": "csv",
170+
"items": {
171+
"type": "string"
172+
}
173+
},
174+
"_parameters.yaml-param8": {
175+
"name": "tags8",
176+
"in": "query",
177+
"description": "tags to filter by",
178+
"required": false,
179+
"type": "array",
180+
"collectionFormat": "csv",
181+
"items": {
182+
"type": "string"
183+
}
184+
},
185+
"_parameters.yaml-param9": {
186+
"name": "tags9",
187+
"in": "query",
188+
"description": "tags to filter by",
189+
"required": false,
190+
"type": "array",
191+
"collectionFormat": "csv",
192+
"items": {
193+
"type": "string"
194+
}
195+
},
196+
"_parameters.yaml-param10": {
197+
"name": "tags10",
198+
"in": "query",
199+
"description": "tags to filter by",
200+
"required": false,
201+
"type": "array",
202+
"collectionFormat": "csv",
203+
"items": {
204+
"type": "string"
205+
}
206+
},
207+
"_parameters.yaml-param11": {
208+
"name": "tags11",
209+
"in": "query",
210+
"description": "tags to filter by",
211+
"required": false,
212+
"type": "array",
213+
"collectionFormat": "csv",
214+
"items": {
215+
"type": "string"
216+
}
217+
},
218+
"_parameters.yaml-param12": {
219+
"name": "tags12",
220+
"in": "query",
221+
"description": "tags to filter by",
222+
"required": false,
223+
"type": "array",
224+
"collectionFormat": "csv",
225+
"items": {
226+
"type": "string"
227+
}
228+
}
229+
}
230+
}
231+
}

0 commit comments

Comments
 (0)