Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:postmanlabs/openapi-to-postman i…
Browse files Browse the repository at this point in the history
…nto feature/readonly-writeonly-support-v2
  • Loading branch information
VShingala committed Aug 9, 2024
2 parents c6b3852 + 34f299e commit a0aa439
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 64 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [Unreleased]

## [v4.23.1] - 2024-07-22

### Added

- Conversion - Added option to set preferred request body content-type and use the first mentioned content-type as request body.

### Fixed

- Fixed issue with getOptions() API where default module version was still v1.
- Fix to convert "format:binary" to "type:file" for requests with formdata body.

## [v4.22.0] - 2024-07-10

### Chore
Expand Down Expand Up @@ -626,7 +637,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.22.0...HEAD
[Unreleased]: https://github.com/postmanlabs/openapi-to-postman/compare/v4.23.1...HEAD

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

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

Expand Down
2 changes: 1 addition & 1 deletion lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const _ = require('lodash'),
jsonPointerDecodeAndReplace,
generateObjectName
} = require('./jsonPointer'),
traverseUtility = require('traverse'),
traverseUtility = require('neotraverse/legacy'),
parse = require('./parse.js'),
{ ParseError } = require('./common/ParseError'),
Utils = require('./utils'),
Expand Down
2 changes: 1 addition & 1 deletion lib/deref.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const _ = require('lodash'),
isAllOf: false
},
DEFAULT_SCHEMA_UTILS = require('./30XUtils/schemaUtils30X'),
traverseUtility = require('traverse'),
traverseUtility = require('neotraverse/legacy'),
PROPERTIES_TO_ASSIGN_ON_CASCADE = ['type', 'nullable'];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/relatedFiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const parse = require('./parse.js'),
traverseUtility = require('traverse'),
traverseUtility = require('neotraverse/legacy'),
BROWSER = 'browser',
{ DFS } = require('./dfs'),
{ isExtRef, removeLocalReferenceFromPath } = require('./jsonPointer');
Expand Down
2 changes: 1 addition & 1 deletion lib/schemaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/sc
{ Node, Trie } = require('./trie.js'),
{ validateSchema } = require('./ajValidation/ajvValidation'),
inputValidation = require('./30XUtils/inputValidation'),
traverseUtility = require('traverse'),
traverseUtility = require('neotraverse/legacy'),
{ ParseError } = require('./common/ParseError.js'),
SCHEMA_FORMATS = {
DEFAULT: 'default', // used for non-request-body data and json
Expand Down
6 changes: 2 additions & 4 deletions libV2/schemaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const schemaFaker = require('../assets/json-schema-faker'),
'ipv4', 'ipv6',
'regex',
'uuid',
'binary',
'json-pointer',
'int64',
'float',
Expand Down Expand Up @@ -652,7 +653,6 @@ let QUERYPARAM = 'query',
if (
property.format === 'decimal' ||
property.format === 'byte' ||
property.format === 'binary' ||
property.format === 'password' ||
property.format === 'unix-time'
) {
Expand Down Expand Up @@ -983,7 +983,6 @@ let QUERYPARAM = 'query',
for (const prop in resolvedSchema.properties) {
if (resolvedSchema.properties.hasOwnProperty(prop)) {
if (
resolvedSchema.properties[prop].format === 'binary' ||
resolvedSchema.properties[prop].format === 'byte' ||
resolvedSchema.properties[prop].format === 'decimal'
) {
Expand Down Expand Up @@ -1508,7 +1507,6 @@ let QUERYPARAM = 'query',
}

if (
requestBodySchema.properties[prop].format === 'binary' ||
requestBodySchema.properties[prop].format === 'byte' ||
requestBodySchema.properties[prop].format === 'decimal'
) {
Expand Down Expand Up @@ -1668,7 +1666,7 @@ let QUERYPARAM = 'query',

// TODO: Add handling for headers from encoding

if (paramSchema && paramSchema.type === 'binary') {
if (paramSchema && paramSchema.type === 'string' && paramSchema.format === 'binary') {
param = {
key,
value: '',
Expand Down
3 changes: 2 additions & 1 deletion libV2/validationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ schemaFaker.option({
maxItems: 20, // limit on maximum number of items faked for (type: array)
useDefaultValue: true,
ignoreMissingRefs: true,
avoidExampleItemsLength: true // option to avoid validating type array schema example's minItems and maxItems props.
avoidExampleItemsLength: true, // option to avoid validating type array schema example's minItems and maxItems props.
failOnInvalidFormat: false
});

/**
Expand Down
101 changes: 52 additions & 49 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.22.0",
"version": "4.23.1",
"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 @@ -125,13 +125,13 @@
"json-pointer": "0.6.2",
"json-schema-merge-allof": "0.8.1",
"lodash": "4.17.21",
"neotraverse": "0.6.15",
"oas-resolver-browser": "2.5.6",
"object-hash": "3.0.0",
"graphlib": "2.1.8",
"path-browserify": "1.0.1",
"postman-collection": "^4.4.0",
"swagger2openapi": "7.0.8",
"traverse": "0.6.6",
"yaml": "1.10.2"
},
"author": "Postman Labs <[email protected]>",
Expand Down
Loading

0 comments on commit a0aa439

Please sign in to comment.