Skip to content

Commit 85bebdc

Browse files
authored
Merge pull request #765 from postmanlabs/release/v4.17.0
Release version v4.17.0
2 parents 206cd9a + 6b93f95 commit 85bebdc

File tree

5 files changed

+114
-20
lines changed

5 files changed

+114
-20
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
## [v4.17.0] - 2023-09-12
6+
57
## [v4.16.0] - 2023-08-18
68

79
### Added
@@ -594,7 +596,9 @@ Newer releases follow the [Keep a Changelog](https://keepachangelog.com/en/1.0.0
594596

595597
- Base release
596598

597-
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.16.0...HEAD
599+
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.17.0...HEAD
600+
601+
[v4.17.0]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.16.0...v4.17.0
598602

599603
[v4.16.0]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.15.0...v4.16.0
600604

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openapi-to-postmanv2",
3-
"version": "4.16.0",
3+
"version": "4.17.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",
@@ -128,7 +128,7 @@
128128
"object-hash": "3.0.0",
129129
"graphlib": "2.1.8",
130130
"path-browserify": "1.0.1",
131-
"postman-collection": "4.1.5",
131+
"postman-collection": "4.2.1",
132132
"swagger2openapi": "7.0.8",
133133
"traverse": "0.6.6",
134134
"yaml": "1.10.2"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
openapi: "3.0.0"
2+
info:
3+
version: "1.0.0"
4+
title: "Sample API"
5+
description: Buy or rent spacecrafts
6+
7+
paths:
8+
/space/{spacecraftId}:
9+
get:
10+
parameters:
11+
- name: spacecraftId
12+
description: "Required spacecraftId path param"
13+
in: path
14+
required: true
15+
schema:
16+
type: string
17+
- name: pathParamOptional
18+
description: "Path param optional description"
19+
in: path
20+
required: false
21+
schema:
22+
type: string
23+
- name: limit
24+
in: query
25+
description: "QUERY PARAM DESCRIPTION"
26+
required: true
27+
schema:
28+
type: integer
29+
format: int32
30+
- name: optionalQueryParam
31+
in: query
32+
description: "QUERY PARAM Optional"
33+
required: false
34+
schema:
35+
type: integer
36+
format: int32
37+
- name: page
38+
in: header
39+
description: "HEADER PARAM DESCRIPTION"
40+
required: true
41+
schema:
42+
type: string
43+
- name: offset
44+
in: header
45+
description: "HEADER PARAM Optional"
46+
required: false
47+
schema:
48+
type: string
49+
50+
summary: Read a spacecraft
51+
responses:
52+
"201":
53+
description: The spacecraft corresponding to the provided `spacecraftId`
54+
content:
55+
application/json:
56+
schema:
57+
type: string

test/unit/convertV2.test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const expect = require('chai').expect,
5353
path.join(__dirname, VALID_OPENAPI_PATH, '/query_param_with_enum_resolve_as_example.json'),
5454
formDataParamDescription = path.join(__dirname, VALID_OPENAPI_PATH, '/form_data_param_description.yaml'),
5555
allHTTPMethodsSpec = path.join(__dirname, VALID_OPENAPI_PATH, '/all-http-methods.yaml'),
56+
descriptionTestSpec = path.join(__dirname, VALID_OPENAPI_PATH, '/description-test.yaml'),
5657
invalidNullInfo = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-null-info.json'),
5758
invalidNullInfoTitle = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-info-null-title.json'),
5859
invalidNullInfoVersion = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-info-null-version.json'),
@@ -1159,6 +1160,38 @@ describe('The convert v2 Function', function() {
11591160
});
11601161
});
11611162

1163+
it('should generate a collection with description for Query Params, Path variables and Headers', function(done) {
1164+
var openapi = fs.readFileSync(descriptionTestSpec, 'utf8');
1165+
1166+
Converter.convertV2({ type: 'string', data: openapi },
1167+
{}, (err, conversionResult) => {
1168+
expect(
1169+
conversionResult.output[0].data.item[0].item[0].item[0].request.url.query[0].description.content
1170+
).to.equal('(Required) QUERY PARAM DESCRIPTION');
1171+
1172+
expect(
1173+
conversionResult.output[0].data.item[0].item[0].item[0].request.url.query[1].description.content
1174+
).to.equal('QUERY PARAM Optional');
1175+
1176+
expect(
1177+
conversionResult.output[0].data.item[0].item[0].item[0].request.url.variable[0].description.content
1178+
).to.equal('(Required) Required spacecraftId path param');
1179+
1180+
expect(
1181+
conversionResult.output[0].data.item[0].item[0].item[0].request.url.variable[1].description.content
1182+
).to.equal('Path param optional description');
1183+
1184+
expect(
1185+
conversionResult.output[0].data.item[0].item[0].item[0].request.header[0].description.content
1186+
).to.equal('(Required) HEADER PARAM DESCRIPTION');
1187+
1188+
expect(
1189+
conversionResult.output[0].data.item[0].item[0].item[0].request.header[1].description.content
1190+
).to.equal('HEADER PARAM Optional');
1191+
done();
1192+
});
1193+
});
1194+
11621195
it('Should have disableBodyPruning option for protocolProfileBehavior set to true for all types of request' +
11631196
allHTTPMethodsSpec, function (done) {
11641197
var openapi = fs.readFileSync(allHTTPMethodsSpec, 'utf8');

0 commit comments

Comments
 (0)