Skip to content

Commit

Permalink
Merge pull request #765 from postmanlabs/release/v4.17.0
Browse files Browse the repository at this point in the history
Release version v4.17.0
  • Loading branch information
jatin3893 committed Sep 12, 2023
2 parents 206cd9a + 6b93f95 commit 85bebdc
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 20 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

## [v4.17.0] - 2023-09-12

## [v4.16.0] - 2023-08-18

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

- Base release

[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.16.0...HEAD
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.17.0...HEAD

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

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

Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-to-postmanv2",
"version": "4.16.0",
"version": "4.17.0",
"description": "Convert a given OpenAPI specification to Postman Collection v2.0",
"homepage": "https://github.com/postmanlabs/openapi-to-postman",
"bugs": "https://github.com/postmanlabs/openapi-to-postman/issues",
Expand Down Expand Up @@ -128,7 +128,7 @@
"object-hash": "3.0.0",
"graphlib": "2.1.8",
"path-browserify": "1.0.1",
"postman-collection": "4.1.5",
"postman-collection": "4.2.1",
"swagger2openapi": "7.0.8",
"traverse": "0.6.6",
"yaml": "1.10.2"
Expand Down
57 changes: 57 additions & 0 deletions test/data/valid_openapi/description-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
openapi: "3.0.0"
info:
version: "1.0.0"
title: "Sample API"
description: Buy or rent spacecrafts

paths:
/space/{spacecraftId}:
get:
parameters:
- name: spacecraftId
description: "Required spacecraftId path param"
in: path
required: true
schema:
type: string
- name: pathParamOptional
description: "Path param optional description"
in: path
required: false
schema:
type: string
- name: limit
in: query
description: "QUERY PARAM DESCRIPTION"
required: true
schema:
type: integer
format: int32
- name: optionalQueryParam
in: query
description: "QUERY PARAM Optional"
required: false
schema:
type: integer
format: int32
- name: page
in: header
description: "HEADER PARAM DESCRIPTION"
required: true
schema:
type: string
- name: offset
in: header
description: "HEADER PARAM Optional"
required: false
schema:
type: string

summary: Read a spacecraft
responses:
"201":
description: The spacecraft corresponding to the provided `spacecraftId`
content:
application/json:
schema:
type: string
33 changes: 33 additions & 0 deletions test/unit/convertV2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const expect = require('chai').expect,
path.join(__dirname, VALID_OPENAPI_PATH, '/query_param_with_enum_resolve_as_example.json'),
formDataParamDescription = path.join(__dirname, VALID_OPENAPI_PATH, '/form_data_param_description.yaml'),
allHTTPMethodsSpec = path.join(__dirname, VALID_OPENAPI_PATH, '/all-http-methods.yaml'),
descriptionTestSpec = path.join(__dirname, VALID_OPENAPI_PATH, '/description-test.yaml'),
invalidNullInfo = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-null-info.json'),
invalidNullInfoTitle = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-info-null-title.json'),
invalidNullInfoVersion = path.join(__dirname, INVALID_OPENAPI_PATH, '/invalid-info-null-version.json'),
Expand Down Expand Up @@ -1159,6 +1160,38 @@ describe('The convert v2 Function', function() {
});
});

it('should generate a collection with description for Query Params, Path variables and Headers', function(done) {
var openapi = fs.readFileSync(descriptionTestSpec, 'utf8');

Converter.convertV2({ type: 'string', data: openapi },
{}, (err, conversionResult) => {
expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.url.query[0].description.content
).to.equal('(Required) QUERY PARAM DESCRIPTION');

expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.url.query[1].description.content
).to.equal('QUERY PARAM Optional');

expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.url.variable[0].description.content
).to.equal('(Required) Required spacecraftId path param');

expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.url.variable[1].description.content
).to.equal('Path param optional description');

expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.header[0].description.content
).to.equal('(Required) HEADER PARAM DESCRIPTION');

expect(
conversionResult.output[0].data.item[0].item[0].item[0].request.header[1].description.content
).to.equal('HEADER PARAM Optional');
done();
});
});

it('Should have disableBodyPruning option for protocolProfileBehavior set to true for all types of request' +
allHTTPMethodsSpec, function (done) {
var openapi = fs.readFileSync(allHTTPMethodsSpec, 'utf8');
Expand Down

0 comments on commit 85bebdc

Please sign in to comment.