Skip to content

Commit a0aa439

Browse files
committed
Merge branch 'develop' of github.com:postmanlabs/openapi-to-postman into feature/readonly-writeonly-support-v2
2 parents c6b3852 + 34f299e commit a0aa439

File tree

12 files changed

+140
-64
lines changed

12 files changed

+140
-64
lines changed

CHANGELOG.md

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

33
## [Unreleased]
44

5+
## [v4.23.1] - 2024-07-22
6+
7+
### Added
8+
9+
- Conversion - Added option to set preferred request body content-type and use the first mentioned content-type as request body.
10+
11+
### Fixed
12+
13+
- Fixed issue with getOptions() API where default module version was still v1.
14+
- Fix to convert "format:binary" to "type:file" for requests with formdata body.
15+
516
## [v4.22.0] - 2024-07-10
617

718
### Chore
@@ -626,7 +637,9 @@ Newer releases follow the [Keep a Changelog](https://keepachangelog.com/en/1.0.0
626637

627638
- Base release
628639

629-
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.22.0...HEAD
640+
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.23.1...HEAD
641+
642+
[v4.23.1]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.22.0...v4.23.1
630643

631644
[v4.22.0]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.21.0...v4.22.0
632645

lib/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const _ = require('lodash'),
1414
jsonPointerDecodeAndReplace,
1515
generateObjectName
1616
} = require('./jsonPointer'),
17-
traverseUtility = require('traverse'),
17+
traverseUtility = require('neotraverse/legacy'),
1818
parse = require('./parse.js'),
1919
{ ParseError } = require('./common/ParseError'),
2020
Utils = require('./utils'),

lib/deref.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const _ = require('lodash'),
3535
isAllOf: false
3636
},
3737
DEFAULT_SCHEMA_UTILS = require('./30XUtils/schemaUtils30X'),
38-
traverseUtility = require('traverse'),
38+
traverseUtility = require('neotraverse/legacy'),
3939
PROPERTIES_TO_ASSIGN_ON_CASCADE = ['type', 'nullable'];
4040

4141
/**

lib/relatedFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const parse = require('./parse.js'),
2-
traverseUtility = require('traverse'),
2+
traverseUtility = require('neotraverse/legacy'),
33
BROWSER = 'browser',
44
{ DFS } = require('./dfs'),
55
{ isExtRef, removeLocalReferenceFromPath } = require('./jsonPointer');

lib/schemaUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/sc
2424
{ Node, Trie } = require('./trie.js'),
2525
{ validateSchema } = require('./ajValidation/ajvValidation'),
2626
inputValidation = require('./30XUtils/inputValidation'),
27-
traverseUtility = require('traverse'),
27+
traverseUtility = require('neotraverse/legacy'),
2828
{ ParseError } = require('./common/ParseError.js'),
2929
SCHEMA_FORMATS = {
3030
DEFAULT: 'default', // used for non-request-body data and json

libV2/schemaUtils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const schemaFaker = require('../assets/json-schema-faker'),
4545
'ipv4', 'ipv6',
4646
'regex',
4747
'uuid',
48+
'binary',
4849
'json-pointer',
4950
'int64',
5051
'float',
@@ -652,7 +653,6 @@ let QUERYPARAM = 'query',
652653
if (
653654
property.format === 'decimal' ||
654655
property.format === 'byte' ||
655-
property.format === 'binary' ||
656656
property.format === 'password' ||
657657
property.format === 'unix-time'
658658
) {
@@ -983,7 +983,6 @@ let QUERYPARAM = 'query',
983983
for (const prop in resolvedSchema.properties) {
984984
if (resolvedSchema.properties.hasOwnProperty(prop)) {
985985
if (
986-
resolvedSchema.properties[prop].format === 'binary' ||
987986
resolvedSchema.properties[prop].format === 'byte' ||
988987
resolvedSchema.properties[prop].format === 'decimal'
989988
) {
@@ -1508,7 +1507,6 @@ let QUERYPARAM = 'query',
15081507
}
15091508

15101509
if (
1511-
requestBodySchema.properties[prop].format === 'binary' ||
15121510
requestBodySchema.properties[prop].format === 'byte' ||
15131511
requestBodySchema.properties[prop].format === 'decimal'
15141512
) {
@@ -1668,7 +1666,7 @@ let QUERYPARAM = 'query',
16681666

16691667
// TODO: Add handling for headers from encoding
16701668

1671-
if (paramSchema && paramSchema.type === 'binary') {
1669+
if (paramSchema && paramSchema.type === 'string' && paramSchema.format === 'binary') {
16721670
param = {
16731671
key,
16741672
value: '',

libV2/validationUtils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ schemaFaker.option({
8585
maxItems: 20, // limit on maximum number of items faked for (type: array)
8686
useDefaultValue: true,
8787
ignoreMissingRefs: true,
88-
avoidExampleItemsLength: true // option to avoid validating type array schema example's minItems and maxItems props.
88+
avoidExampleItemsLength: true, // option to avoid validating type array schema example's minItems and maxItems props.
89+
failOnInvalidFormat: false
8990
});
9091

9192
/**

package-lock.json

Lines changed: 52 additions & 49 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.22.0",
3+
"version": "4.23.1",
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",
@@ -125,13 +125,13 @@
125125
"json-pointer": "0.6.2",
126126
"json-schema-merge-allof": "0.8.1",
127127
"lodash": "4.17.21",
128+
"neotraverse": "0.6.15",
128129
"oas-resolver-browser": "2.5.6",
129130
"object-hash": "3.0.0",
130131
"graphlib": "2.1.8",
131132
"path-browserify": "1.0.1",
132133
"postman-collection": "^4.4.0",
133134
"swagger2openapi": "7.0.8",
134-
"traverse": "0.6.6",
135135
"yaml": "1.10.2"
136136
},
137137
"author": "Postman Labs <[email protected]>",

0 commit comments

Comments
 (0)