From 4da5c77ecc79b3a76a13d336f6fa12c14aee24f8 Mon Sep 17 00:00:00 2001 From: Thim Date: Mon, 26 Aug 2024 01:07:03 +0200 Subject: [PATCH 1/7] overwriteRequestQueryParams - Add additional form encoded array query params --- .../overwriteRequestQueryParams.test.ts.snap | 5 +- .../overwriteRequestQueryParams.test.ts | 199 ++++++++++++++++++ .../overwrites/overwriteRequestQueryParams.ts | 37 ++-- 3 files changed, 225 insertions(+), 16 deletions(-) diff --git a/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap b/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap index 1452fc07..f3875e1b 100644 --- a/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap +++ b/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap @@ -87,10 +87,7 @@ Array [ "value": "true", }, Object { - "description": Object { - "content": "Additional query param", - "type": "text/plain", - }, + "description": "Additional query param", "disabled": false, "key": "add-a-query-param", "value": "foo-bar-baz", diff --git a/src/application/overwrites/overwriteRequestQueryParams.test.ts b/src/application/overwrites/overwriteRequestQueryParams.test.ts index 2eadf98e..fb75ca67 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.test.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.test.ts @@ -661,4 +661,203 @@ describe('overwriteRequestQueryParams', () => { { key: 'number', value: 'newNumber2' } ]) }) + + it('should correctly handle multiple duplicate query params with less matching overwrite values', async () => { + const overwriteValues = [ + { + key: 'name', + value: 'newName', + overwrite: true + }, + { + key: 'ids', + value: 'newId1', + overwrite: true + }, + { + key: 'first', + value: 'newFirst', + overwrite: true + }, + { + key: 'ids', + value: 'newId2', + overwrite: true + } + ] + + // Set up initial query params + const pmQueryParams = [ + { + key: 'name', + value: 'oldName', + disabled: false + }, + { + key: 'ids', + value: 'oldId1', + disabled: false + }, + { + key: 'ids', + value: 'oldId2', + disabled: false + }, + { + key: 'ids', + value: 'oldId3', + disabled: false + }, + { + key: 'first', + value: 'oldFirst', + disabled: false + }, + { + key: 'last', + value: 'oldLast', + disabled: false + } + ] + + // Add the query params to the pmOperation + // pmQueryParams.forEach(param => pmOperation.item.request.url.query.upsert(new QueryParam(param))) + pmQueryParams.forEach(param => { + pmOperation.item.request.url.query.append(new QueryParam(param)) + }) + + const dto = { + overwriteValues, + pmOperation, + oaOperation + } + + const result = overwriteRequestQueryParams(dto) + + expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ + { key: 'raw', value: 'true' }, + { key: 'name', value: 'newName' }, + { key: 'ids', value: 'newId1' }, + { key: 'ids', value: 'newId2' }, + { key: 'ids', value: 'oldId3' }, // unchanged + { key: 'first', value: 'newFirst' }, + { key: 'last', value: 'oldLast' } // unchanged + ]) + }) + + it('should correctly handle multiple duplicate query params with extra matching overwrite values', async () => { + const overwriteValues = [ + { + key: 'name', + value: 'newName', + overwrite: true + }, + { + key: 'ids', + value: 'newId1', + overwrite: true + }, + { + key: 'first', + value: 'newFirst', + overwrite: true + }, + { + key: 'ids', + value: 'newId2', + overwrite: true + }, + { + key: 'ids', + value: 'newId3', + overwrite: true + }, + { + key: 'number', + value: 'newNumber1', + overwrite: true + }, + { + key: 'number', + value: 'newNumber2', + overwrite: true + }, + { + key: 'word', + value: 'newWord', + overwrite: true + } + ] + + // Set up initial query params + const pmQueryParams = [ + { + key: 'name', + value: 'oldName', + disabled: false + }, + { + key: 'ids', + value: 'oldId1', + disabled: false + }, + { + key: 'ids', + value: 'oldId2', + disabled: false + }, + { + key: 'first', + value: 'oldFirst', + disabled: false + }, + { + key: 'last', + value: 'oldLast', + disabled: false + }, + { + key: 'number', + value: 'oldNumber1', + disabled: false + }, + { + key: 'word', + value: 'oldWord', + disabled: false + }, + { + key: 'number', + value: 'oldNumber2', + disabled: false + } + ] + + // Add the query params to the pmOperation + // pmQueryParams.forEach(param => pmOperation.item.request.url.query.upsert(new QueryParam(param))) + pmQueryParams.forEach(param => { + pmOperation.item.request.url.query.append(new QueryParam(param)) + }) + + const dto = { + overwriteValues, + pmOperation, + oaOperation + } + + const result = overwriteRequestQueryParams(dto) + + expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ + { key: 'raw', value: 'true' }, + { key: 'name', value: 'newName' }, + { key: 'ids', value: 'newId1' }, + { key: 'ids', value: 'newId2' }, + { key: 'first', value: 'newFirst' }, + { key: 'last', value: 'oldLast' }, // unchanged + { key: 'number', value: 'newNumber1' }, + { key: 'word', value: 'newWord' }, + { key: 'number', value: 'newNumber2' }, + { key: 'ids', value: 'newId3' } // Extra added + ]) + }) }) diff --git a/src/application/overwrites/overwriteRequestQueryParams.ts b/src/application/overwrites/overwriteRequestQueryParams.ts index 1b7e3b14..f387becd 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.ts @@ -17,8 +17,29 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa // Get all Postman query params const queryKeys = pmOperation.item.request.url.query.map(({ key }) => key) + // Util function to get the count of key + const getKeyCount = (key, counter) => counter[key] || 0 + + // Util function to increment the key count + const incrementKeyCount = (key, counter) => { + counter[key] = getKeyCount(key, counter) + 1 + return counter[key] + } + + // Create a counter for each key in queryKeys to track their usage + const queryKeyUsage = {} + queryKeys.forEach(key => incrementKeyCount(key, queryKeyUsage)) + // Detect overwrite query params that do not exist in the Postman collection - const insertNewKeys = overwriteValues.filter(x => !queryKeys.includes(x.key)) + const insertNewKeys = overwriteValues.filter(({ key }) => { + if (queryKeyUsage[key]) { + // If there's an unused key in queryKeys, decrement the counter + queryKeyUsage[key]-- + return false // This key does not need to be inserted + } + // If no matching key left in queryKeys, this overwriteValue key should be inserted + return true + }) // Extract duplicate query params const duplicateKeys = _(queryKeys) @@ -32,15 +53,6 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa const overwriteKeyCounters = {} const duplicateKeyCounters = {} - // Util function to get the count of key - const getKeyCount = (key, counter) => counter[key] || 0 - - // Util function to increment the key count - const incrementKeyCount = (key, counter) => { - counter[key] = getKeyCount(key, counter) + 1 - return counter[key] - } - pmOperation.item.request.url.query.each(pmQueryParam => { // Increment counter for query param const queryKeyIndex = incrementKeyCount(pmQueryParam.key, queryKeyCounters) @@ -89,10 +101,11 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa const matchingOverwriteItems = overwriteValues.filter(item => item.key === pmQueryParam.key) const overwriteObj = matchingOverwriteItems[duplicateKeyIndex] - if (overwriteObj.value) { + if (overwriteObj?.value) { overwriteValue = overwriteObj.value incrementKeyCount(overwriteItem.key, duplicateKeyCounters) duplicateFound = true + } else { } } @@ -162,7 +175,7 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa if (queryToInsert.description) newPmQueryParam.description = queryToInsert.description // Add Postman query param - pmOperation.item.request.url.query.upsert(newPmQueryParam) + pmOperation.item.request.url.query.append(newPmQueryParam) // Add queryParams if (pmOperation?.queryParams && Array.isArray(pmOperation.queryParams)) { From a165bf64e971e9a5b3f7ef2927e13c67f3243808 Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 11:24:00 +0200 Subject: [PATCH 2/7] overwriteRequestQueryParams - Add additional form encoded array query params --- .../overwriteRequestQueryParams.test.ts | 226 ++++++++++++++++++ .../overwrites/overwriteRequestQueryParams.ts | 54 +++-- 2 files changed, 262 insertions(+), 18 deletions(-) diff --git a/src/application/overwrites/overwriteRequestQueryParams.test.ts b/src/application/overwrites/overwriteRequestQueryParams.test.ts index fb75ca67..44fa7e2e 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.test.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.test.ts @@ -860,4 +860,230 @@ describe('overwriteRequestQueryParams', () => { { key: 'ids', value: 'newId3' } // Extra added ]) }) + + it.skip('should remove all items when multiple duplicate query params', async () => { + const overwriteValues = [ + { + key: 'name', + value: 'newName', + overwrite: true + }, + { + key: 'ids', + value: 'newId1', + overwrite: true + }, + { + key: 'first', + value: 'newFirst', + overwrite: true + }, + { + key: 'ids', + value: 'newId2', + remove: true + }, + { + key: 'ids', + value: 'newId3', + overwrite: true + }, + { + key: 'number', + value: 'newNumber1', + overwrite: true + }, + { + key: 'number', + value: 'newNumber2', + overwrite: true + }, + { + key: 'word', + value: 'newWord', + overwrite: true + } + ] + + // Set up initial query params + const pmQueryParams = [ + { + key: 'name', + value: 'oldName', + disabled: false + }, + { + key: 'first', + value: 'oldFirst', + disabled: false + }, + { + key: 'last', + value: 'oldLast', + disabled: false + }, + { + key: 'number', + value: 'oldNumber1', + disabled: false + }, + { + key: 'word', + value: 'oldWord', + disabled: false + }, + { + key: 'number', + value: 'oldNumber2', + disabled: false + } + ] + + // Add the query params to the pmOperation + // pmQueryParams.forEach(param => pmOperation.item.request.url.query.upsert(new QueryParam(param))) + pmQueryParams.forEach(param => { + pmOperation.item.request.url.query.append(new QueryParam(param)) + }) + + const dto = { + overwriteValues, + pmOperation, + oaOperation + } + + const result = overwriteRequestQueryParams(dto) + + expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ + { key: 'raw', value: 'true' }, + { key: 'name', value: 'newName' }, + { key: 'ids', value: 'newId1' }, // All should be removed + // { key: 'ids', value: 'newId2' }, // All should be removed + { key: 'ids', value: 'newId3' }, // All should be removed + { key: 'first', value: 'newFirst' }, + { key: 'last', value: 'oldLast' }, // unchanged + { key: 'number', value: 'newNumber1' }, + { key: 'word', value: 'newWord' }, + { key: 'number', value: 'newNumber2' } + ]) + }) + + it.skip('should remove the correct item when multiple duplicate query params', async () => { + const overwriteValues = [ + { + key: 'name', + value: 'newName', + overwrite: true + }, + { + key: 'ids', + remove: true + }, + { + key: 'first', + value: 'newFirst', + overwrite: true + }, + { + key: 'ids', + value: 'newId2', + overwrite: true + }, + { + key: 'ids', + value: 'newId3', + overwrite: true + }, + { + key: 'number', + value: 'newNumber1', + overwrite: true + }, + { + key: 'number', + value: 'newNumber2', + overwrite: true + }, + { + key: 'word', + value: 'newWord', + overwrite: true + } + ] + + // Set up initial query params + const pmQueryParams = [ + { + key: 'name', + value: 'oldName', + disabled: false + }, + { + key: 'ids', + value: 'oldId1', + disabled: false + }, + { + key: 'ids', + value: 'oldId2', + disabled: false + }, + { + key: 'ids', + value: 'oldId3', + disabled: false + }, + { + key: 'first', + value: 'oldFirst', + disabled: false + }, + { + key: 'last', + value: 'oldLast', + disabled: false + }, + { + key: 'number', + value: 'oldNumber1', + disabled: false + }, + { + key: 'word', + value: 'oldWord', + disabled: false + }, + { + key: 'number', + value: 'oldNumber2', + disabled: false + } + ] + + // Add the query params to the pmOperation + // pmQueryParams.forEach(param => pmOperation.item.request.url.query.upsert(new QueryParam(param))) + pmQueryParams.forEach(param => { + pmOperation.item.request.url.query.append(new QueryParam(param)) + }) + + const dto = { + overwriteValues, + pmOperation, + oaOperation + } + + const result = overwriteRequestQueryParams(dto) + + expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ + { key: 'raw', value: 'true' }, + { key: 'name', value: 'newName' }, + { key: 'ids', value: 'newId1' }, + { key: 'ids', value: 'newId2' }, + // { key: 'ids', value: 'newId3' }, // All should be removed + { key: 'first', value: 'newFirst' }, + { key: 'last', value: 'oldLast' }, // unchanged + { key: 'number', value: 'newNumber1' }, + { key: 'word', value: 'newWord' }, + { key: 'number', value: 'newNumber2' } + ]) + }) }) diff --git a/src/application/overwrites/overwriteRequestQueryParams.ts b/src/application/overwrites/overwriteRequestQueryParams.ts index f387becd..2d882d68 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.ts @@ -3,6 +3,7 @@ import { QueryParam } from 'postman-collection' import { parseTpl, hasTpl, matchWildcard } from '../../utils' import { OverwriteRequestDTO } from './applyOverwrites' import _ from 'lodash' +import { OverwriteQueryParamConfig } from 'types' /** * Overwrite Postman request query params with values defined by the portman testsuite @@ -14,6 +15,8 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa // Early exit if overwrite values are not defined if (!(overwriteValues instanceof Array)) return pmOperation + const _overwriteValues = _.cloneDeep(overwriteValues) + // Get all Postman query params const queryKeys = pmOperation.item.request.url.query.map(({ key }) => key) @@ -53,12 +56,20 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa const overwriteKeyCounters = {} const duplicateKeyCounters = {} + // New list to hold the updated query parameters + let newQueryParams: QueryParam[] = [] + pmOperation.item.request.url.query.each(pmQueryParam => { // Increment counter for query param const queryKeyIndex = incrementKeyCount(pmQueryParam.key, queryKeyCounters) + // Track whether the current query param has been overwritten + let paramOverwritten = false + // Overwrite values for Keys - for (const overwriteItem of overwriteValues) { + for (let i = 0; i < _overwriteValues.length; i++) { + const overwriteItem = _overwriteValues[i] + // Skip keys when no overwrite is defined if ( !(overwriteItem?.key && pmQueryParam?.key && overwriteItem.key === pmQueryParam.key) && @@ -97,15 +108,15 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa overwriteItem.key === pmQueryParam.key && queryKeyIndex === overwriteKeyIndex ) { - const duplicateKeyIndex = getKeyCount(overwriteItem.key, duplicateKeyCounters) - const matchingOverwriteItems = overwriteValues.filter(item => item.key === pmQueryParam.key) + const matchingOverwriteItems = _overwriteValues.filter( + (item: OverwriteQueryParamConfig) => item.key === pmQueryParam.key + ) - const overwriteObj = matchingOverwriteItems[duplicateKeyIndex] + const overwriteObj = matchingOverwriteItems[0] if (overwriteObj?.value) { overwriteValue = overwriteObj.value incrementKeyCount(overwriteItem.key, duplicateKeyCounters) duplicateFound = true - } else { } } @@ -139,21 +150,30 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa pmQueryParam.description = overwriteItem.description } - // Set Postman query param - pmOperation.item.request.url.query.upsert(pmQueryParam) + // Overwrite existing query param + newQueryParams.push(pmQueryParam as QueryParam) + + // Mark as overwritten + paramOverwritten = true - // Break the loop once a matching overwrite is applied + // Remove the overwrite value if it is linked to a duplicated query param if (duplicateFound) { + _.remove(_overwriteValues, (item: OverwriteQueryParamConfig) => item === overwriteItem) break } } + + // If not overwritten, add the original param to the new list + if (!paramOverwritten) { + newQueryParams.push(pmQueryParam) + } }) // Test suite - Remove query param - overwriteValues + _overwriteValues .filter(({ remove }) => remove) .map(paramToRemove => { - pmOperation.item.request.url.removeQueryParams(paramToRemove.key) + newQueryParams = newQueryParams.filter(qp => qp.key !== paramToRemove.key) }) // Test suite - Add query param @@ -174,15 +194,13 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa if (queryToInsert.disable === true) newPmQueryParam.disabled = true if (queryToInsert.description) newPmQueryParam.description = queryToInsert.description - // Add Postman query param - pmOperation.item.request.url.query.append(newPmQueryParam) - - // Add queryParams - if (pmOperation?.queryParams && Array.isArray(pmOperation.queryParams)) { - const { disabled, ...reqQueryParam } = newPmQueryParam - pmOperation.queryParams.push(reqQueryParam) - } + // Add to the new list of query params + newQueryParams.push(newPmQueryParam) }) + // Clear existing query params and the Portman query params ones + pmOperation.item.request.url.query.clear() + newQueryParams.forEach(param => pmOperation.item.request.url.query.append(param)) + return pmOperation } From d98ee89879111162df2b29f692b5ce33c97d7eaa Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 12:02:37 +0200 Subject: [PATCH 3/7] overwriteRequestQueryParams - Remove form encoded array query params --- .../overwriteRequestQueryParams.test.ts.snap | 5 ++- .../overwriteRequestQueryParams.test.ts | 34 +++++++++++-------- .../overwrites/overwriteRequestQueryParams.ts | 33 +++++++++++------- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap b/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap index f3875e1b..8962c131 100644 --- a/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap +++ b/src/application/overwrites/__snapshots__/overwriteRequestQueryParams.test.ts.snap @@ -385,7 +385,10 @@ Array [ exports[`overwriteRequestQueryParams should overwrite the request query param description 1`] = ` Array [ Object { - "description": "foo bar", + "description": Object { + "content": "foo bar", + "type": "text/plain", + }, "disabled": false, "key": "raw", "value": "foo", diff --git a/src/application/overwrites/overwriteRequestQueryParams.test.ts b/src/application/overwrites/overwriteRequestQueryParams.test.ts index 44fa7e2e..f87cc84b 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.test.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.test.ts @@ -861,7 +861,7 @@ describe('overwriteRequestQueryParams', () => { ]) }) - it.skip('should remove all items when multiple duplicate query params', async () => { + it('should remove specific items when multiple duplicate query params', async () => { const overwriteValues = [ { key: 'name', @@ -880,7 +880,6 @@ describe('overwriteRequestQueryParams', () => { }, { key: 'ids', - value: 'newId2', remove: true }, { @@ -912,6 +911,21 @@ describe('overwriteRequestQueryParams', () => { value: 'oldName', disabled: false }, + { + key: 'ids', + value: 'oldId1', + disabled: false + }, + { + key: 'ids', + value: 'oldId2', + disabled: false + }, + { + key: 'ids', + value: 'oldId3', + disabled: false + }, { key: 'first', value: 'oldFirst', @@ -967,7 +981,7 @@ describe('overwriteRequestQueryParams', () => { ]) }) - it.skip('should remove the correct item when multiple duplicate query params', async () => { + it('should remove the all item when multiple duplicate query params', async () => { const overwriteValues = [ { key: 'name', @@ -983,16 +997,6 @@ describe('overwriteRequestQueryParams', () => { value: 'newFirst', overwrite: true }, - { - key: 'ids', - value: 'newId2', - overwrite: true - }, - { - key: 'ids', - value: 'newId3', - overwrite: true - }, { key: 'number', value: 'newNumber1', @@ -1076,8 +1080,8 @@ describe('overwriteRequestQueryParams', () => { expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ { key: 'raw', value: 'true' }, { key: 'name', value: 'newName' }, - { key: 'ids', value: 'newId1' }, - { key: 'ids', value: 'newId2' }, + // { key: 'ids', value: 'newId1' }, // All should be removed + // { key: 'ids', value: 'newId2' }, // All should be removed // { key: 'ids', value: 'newId3' }, // All should be removed { key: 'first', value: 'newFirst' }, { key: 'last', value: 'oldLast' }, // unchanged diff --git a/src/application/overwrites/overwriteRequestQueryParams.ts b/src/application/overwrites/overwriteRequestQueryParams.ts index 2d882d68..1aefac1f 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.ts @@ -1,5 +1,5 @@ import { PostmanMappedOperation } from '../../postman' -import { QueryParam } from 'postman-collection' +import { Description, QueryParam } from 'postman-collection' import { parseTpl, hasTpl, matchWildcard } from '../../utils' import { OverwriteRequestDTO } from './applyOverwrites' import _ from 'lodash' @@ -63,8 +63,8 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa // Increment counter for query param const queryKeyIndex = incrementKeyCount(pmQueryParam.key, queryKeyCounters) - // Track whether the current query param has been overwritten - let paramOverwritten = false + // Track whether the current query param has been overwritten or removed + let paramProcessed = false // Overwrite values for Keys for (let i = 0; i < _overwriteValues.length; i++) { @@ -87,6 +87,15 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa continue } + // Handle removal logic + if (overwriteItem.remove) { + // Increment the counter for removed duplicate query params + incrementKeyCount(overwriteItem.key, duplicateKeyCounters) + paramProcessed = true + _.remove(_overwriteValues, (item: OverwriteQueryParamConfig) => item === overwriteItem) + break + } + // Increment counter for overwrite key const overwriteKeyIndex = incrementKeyCount(overwriteItem.key, overwriteKeyCounters) @@ -147,14 +156,14 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa // Test suite - Overwrite query param description if (overwriteItem?.description) { - pmQueryParam.description = overwriteItem.description + pmQueryParam.description = new Description(overwriteItem.description) } // Overwrite existing query param newQueryParams.push(pmQueryParam as QueryParam) // Mark as overwritten - paramOverwritten = true + paramProcessed = true // Remove the overwrite value if it is linked to a duplicated query param if (duplicateFound) { @@ -163,18 +172,18 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa } } - // If not overwritten, add the original param to the new list - if (!paramOverwritten) { + // If not overwritten or removed, add the original param to the new list + if (!paramProcessed) { newQueryParams.push(pmQueryParam) } }) // Test suite - Remove query param - _overwriteValues - .filter(({ remove }) => remove) - .map(paramToRemove => { - newQueryParams = newQueryParams.filter(qp => qp.key !== paramToRemove.key) - }) + // _overwriteValues + // .filter(({ remove }) => remove) + // .map(paramToRemove => { + // newQueryParams = newQueryParams.filter(qp => qp.key !== paramToRemove.key) + // }) // Test suite - Add query param insertNewKeys From 3f5729d659856d79699e59f6a356ffd89b5e0a40 Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 18:09:17 +0200 Subject: [PATCH 4/7] overwriteRequestQueryParams - Remove form encoded array query params --- .../overwriteRequestQueryParams.test.ts | 14 ++--- .../overwrites/overwriteRequestQueryParams.ts | 63 ++++--------------- 2 files changed, 19 insertions(+), 58 deletions(-) diff --git a/src/application/overwrites/overwriteRequestQueryParams.test.ts b/src/application/overwrites/overwriteRequestQueryParams.test.ts index f87cc84b..4da3995b 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.test.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.test.ts @@ -880,12 +880,12 @@ describe('overwriteRequestQueryParams', () => { }, { key: 'ids', - remove: true + value: 'newId3', + overwrite: true }, { key: 'ids', - value: 'newId3', - overwrite: true + remove: true }, { key: 'number', @@ -970,14 +970,14 @@ describe('overwriteRequestQueryParams', () => { expect(result.item.request.url.query.map(qp => ({ key: qp.key, value: qp.value }))).toEqual([ { key: 'raw', value: 'true' }, { key: 'name', value: 'newName' }, - { key: 'ids', value: 'newId1' }, // All should be removed - // { key: 'ids', value: 'newId2' }, // All should be removed - { key: 'ids', value: 'newId3' }, // All should be removed { key: 'first', value: 'newFirst' }, { key: 'last', value: 'oldLast' }, // unchanged { key: 'number', value: 'newNumber1' }, { key: 'word', value: 'newWord' }, - { key: 'number', value: 'newNumber2' } + { key: 'number', value: 'newNumber2' }, + { key: 'ids', value: 'newId1' }, // All should be removed + // { key: 'ids', value: 'newId2' }, // All should be removed + { key: 'ids', value: 'newId3' } // All should be removed ]) }) diff --git a/src/application/overwrites/overwriteRequestQueryParams.ts b/src/application/overwrites/overwriteRequestQueryParams.ts index 1aefac1f..ae66b1c1 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.ts @@ -17,6 +17,13 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa const _overwriteValues = _.cloneDeep(overwriteValues) + // Test suite - Remove query param + _overwriteValues + .filter(({ remove }) => remove) + .map((paramToRemove: OverwriteQueryParamConfig) => { + pmOperation.item.request.url.removeQueryParams(paramToRemove.key) + }) + // Get all Postman query params const queryKeys = pmOperation.item.request.url.query.map(({ key }) => key) @@ -38,7 +45,7 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa if (queryKeyUsage[key]) { // If there's an unused key in queryKeys, decrement the counter queryKeyUsage[key]-- - return false // This key does not need to be inserted + return false } // If no matching key left in queryKeys, this overwriteValue key should be inserted return true @@ -51,18 +58,10 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa .keys() .value() - // Initialize counters for tracking - const queryKeyCounters = {} - const overwriteKeyCounters = {} - const duplicateKeyCounters = {} - // New list to hold the updated query parameters - let newQueryParams: QueryParam[] = [] + const newQueryParams: QueryParam[] = [] pmOperation.item.request.url.query.each(pmQueryParam => { - // Increment counter for query param - const queryKeyIndex = incrementKeyCount(pmQueryParam.key, queryKeyCounters) - // Track whether the current query param has been overwritten or removed let paramProcessed = false @@ -87,18 +86,6 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa continue } - // Handle removal logic - if (overwriteItem.remove) { - // Increment the counter for removed duplicate query params - incrementKeyCount(overwriteItem.key, duplicateKeyCounters) - paramProcessed = true - _.remove(_overwriteValues, (item: OverwriteQueryParamConfig) => item === overwriteItem) - break - } - - // Increment counter for overwrite key - const overwriteKeyIndex = incrementKeyCount(overwriteItem.key, overwriteKeyCounters) - const generatedName = parseTpl({ template: overwriteItem.value, oaOperation: oaOperation, @@ -106,28 +93,9 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa casing: globals?.variableCasing } }) - let overwriteValue = - overwriteItem?.value && hasTpl(overwriteItem.value) ? generatedName : overwriteItem?.value - // Handle duplicated query params - let duplicateFound = false - if ( - duplicateKeys.length > 0 && - duplicateKeys.includes(pmQueryParam.key) && - overwriteItem.key === pmQueryParam.key && - queryKeyIndex === overwriteKeyIndex - ) { - const matchingOverwriteItems = _overwriteValues.filter( - (item: OverwriteQueryParamConfig) => item.key === pmQueryParam.key - ) - - const overwriteObj = matchingOverwriteItems[0] - if (overwriteObj?.value) { - overwriteValue = overwriteObj.value - incrementKeyCount(overwriteItem.key, duplicateKeyCounters) - duplicateFound = true - } - } + const overwriteValue = + overwriteItem?.value && hasTpl(overwriteItem.value) ? generatedName : overwriteItem?.value // Test suite - Overwrite/extend query param value let hasValue = false @@ -166,7 +134,7 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa paramProcessed = true // Remove the overwrite value if it is linked to a duplicated query param - if (duplicateFound) { + if (duplicateKeys.includes(pmQueryParam.key)) { _.remove(_overwriteValues, (item: OverwriteQueryParamConfig) => item === overwriteItem) break } @@ -178,13 +146,6 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa } }) - // Test suite - Remove query param - // _overwriteValues - // .filter(({ remove }) => remove) - // .map(paramToRemove => { - // newQueryParams = newQueryParams.filter(qp => qp.key !== paramToRemove.key) - // }) - // Test suite - Add query param insertNewKeys .filter(overwriteItem => !(overwriteItem.insert === false)) From 0fbead9fba818b2bbc5001df77a97c9debea1e7d Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 19:19:42 +0200 Subject: [PATCH 5/7] overwriteRequestQueryParams - Add additional form encoded array query params --- .../overwrites/overwriteRequestQueryParams.test.ts | 5 ++--- .../overwrites/overwriteRequestQueryParams.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/application/overwrites/overwriteRequestQueryParams.test.ts b/src/application/overwrites/overwriteRequestQueryParams.test.ts index 4da3995b..e8281c0d 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.test.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.test.ts @@ -769,8 +769,7 @@ describe('overwriteRequestQueryParams', () => { }, { key: 'ids', - value: 'newId3', - overwrite: true + value: 3 }, { key: 'number', @@ -857,7 +856,7 @@ describe('overwriteRequestQueryParams', () => { { key: 'number', value: 'newNumber1' }, { key: 'word', value: 'newWord' }, { key: 'number', value: 'newNumber2' }, - { key: 'ids', value: 'newId3' } // Extra added + { key: 'ids', value: '3' } // Extra added ]) }) diff --git a/src/application/overwrites/overwriteRequestQueryParams.ts b/src/application/overwrites/overwriteRequestQueryParams.ts index ae66b1c1..fbc5da52 100644 --- a/src/application/overwrites/overwriteRequestQueryParams.ts +++ b/src/application/overwrites/overwriteRequestQueryParams.ts @@ -152,15 +152,24 @@ export const overwriteRequestQueryParams = (dto: OverwriteRequestDTO): PostmanMa .filter(overwriteItem => !(overwriteItem.remove === true)) .map(queryToInsert => { // Initialize new Postman query param - const newPmQueryParam = { + let newPmQueryParam = { key: queryToInsert.key, value: '', // description: '', disabled: false } as QueryParam + if (queryToInsert?.key && duplicateKeys.includes(queryToInsert.key)) { + // Take original param based on key name, as starting point for the form encoded param + const queryParamsArray = pmOperation.item.request.url.query.toJSON() + const orgParam = _.find(queryParamsArray, { key: queryToInsert.key }) as QueryParam + if (orgParam) { + newPmQueryParam = orgParam + } + } + // Set query param properties based on the OverwriteValues - if (queryToInsert.value) newPmQueryParam.value = queryToInsert.value + if (queryToInsert?.value) newPmQueryParam.value = queryToInsert.value?.toString() ?? '' if (queryToInsert.disable === true) newPmQueryParam.disabled = true if (queryToInsert.description) newPmQueryParam.description = queryToInsert.description From d30fbbdcb173044d58649320eedb0c7b68e40e9f Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 22:44:48 +0200 Subject: [PATCH 6/7] Bumped Newman --- package-lock.json | 164 +++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 46 insertions(+), 120 deletions(-) diff --git a/package-lock.json b/package-lock.json index 61b4e69d..c5a4c3e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "fs-extra": "^10.1.0", "lodash": "^4.17.21", "neotraverse": "^0.6.15", - "newman": "^6.2.0", + "newman": "^6.2.1", "node-emoji": "^1.11.0", "openapi-format": "^1.22.3", "openapi-to-postmanv2": "4.24.0", @@ -3906,7 +3906,8 @@ "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true }, "node_modules/follow-redirects": { "version": "1.15.6", @@ -5605,9 +5606,9 @@ } }, "node_modules/jose": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.6.3.tgz", - "integrity": "sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==", + "version": "4.14.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.4.tgz", + "integrity": "sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -6053,9 +6054,9 @@ } }, "node_modules/newman": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/newman/-/newman-6.2.0.tgz", - "integrity": "sha512-CHo/wMv+Q9B3YcIJ18pdmY9XN9X8mc2hXso8yybeclV0BVPSFz1+P5vJELWg5DB/qJgxJOh+B+k+i9tTqfzcbw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/newman/-/newman-6.2.1.tgz", + "integrity": "sha512-Zq8Sr5GFF+OXs5yIbyglLMKMh1WNMjYVV0yZaSBZ+DIgQOIWcxT8QTfbrl/YUGrLyT4rjpu+yZ/Z+kozw79GEA==", "dependencies": { "@postman/tough-cookie": "4.1.3-postman.1", "async": "3.2.5", @@ -6069,10 +6070,10 @@ "liquid-json": "0.3.1", "lodash": "4.17.21", "mkdirp": "3.0.1", - "postman-collection": "4.5.0", + "postman-collection": "4.4.0", "postman-collection-transformer": "4.1.8", - "postman-request": "2.88.1-postman.39", - "postman-runtime": "7.41.2", + "postman-request": "2.88.1-postman.34", + "postman-runtime": "7.39.1", "pretty-ms": "7.0.1", "semver": "7.6.3", "serialised-error": "1.1.3", @@ -6094,27 +6095,6 @@ "node": ">=16" } }, - "node_modules/newman/node_modules/postman-collection": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.5.0.tgz", - "integrity": "sha512-152JSW9pdbaoJihwjc7Q8lc3nPg/PC9lPTHdMk7SHnHhu/GBJB7b2yb9zG7Qua578+3PxkQ/HYBuXpDSvsf7GQ==", - "dependencies": { - "@faker-js/faker": "5.5.3", - "file-type": "3.9.0", - "http-reasons": "0.1.0", - "iconv-lite": "0.6.3", - "liquid-json": "0.3.1", - "lodash": "4.17.21", - "mime-format": "2.0.1", - "mime-types": "2.1.35", - "postman-url-encoder": "3.0.5", - "semver": "7.6.3", - "uuid": "8.3.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/newman/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -6880,13 +6860,13 @@ } }, "node_modules/postman-request": { - "version": "2.88.1-postman.39", - "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.39.tgz", - "integrity": "sha512-rsncxxDlbn1YpygXSgJqbJzIjGlHFcZjbYDzeBPTQHMDfLuSTzZz735JHV8i1+lOROuJ7MjNap4eaSD3UijHzQ==", + "version": "2.88.1-postman.34", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.34.tgz", + "integrity": "sha512-GkolJ4cIzgamcwHRDkeZc/taFWO1u2HuGNML47K9ZAsFH2LdEkS5Yy8QanpzhjydzV3WWthl9v60J8E7SjKodQ==", "dependencies": { "@postman/form-data": "~3.1.1", "@postman/tough-cookie": "~4.1.3-postman.1", - "@postman/tunnel-agent": "^0.6.4", + "@postman/tunnel-agent": "^0.6.3", "aws-sign2": "~0.7.0", "aws4": "^1.12.0", "brotli": "^1.3.3", @@ -6908,111 +6888,52 @@ "uuid": "^8.3.2" }, "engines": { - "node": ">= 16" + "node": ">= 6" } }, "node_modules/postman-runtime": { - "version": "7.41.2", - "resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.41.2.tgz", - "integrity": "sha512-efKnii+yBfqZMRjV5zFh4VXogLeZB58HmLkgT+/sZcjglth23wzp+QRlkl4nbgcL2SZX6e5cLI2/aG2Of3wMyg==", + "version": "7.39.1", + "resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.39.1.tgz", + "integrity": "sha512-IRNrBE0l1K3ZqQhQVYgF6MPuqOB9HqYncal+a7RpSS+sysKLhJMkC9SfUn1HVuOpokdPkK92ykvPzj8kCOLYAg==", "dependencies": { "@postman/tough-cookie": "4.1.3-postman.1", "async": "3.2.5", - "aws4": "1.13.1", + "aws4": "1.12.0", "handlebars": "4.7.8", "httpntlm": "1.8.13", - "jose": "5.6.3", + "jose": "4.14.4", "js-sha512": "0.9.0", "lodash": "4.17.21", "mime-types": "2.1.35", "node-forge": "1.3.1", "node-oauth1": "1.3.0", "performance-now": "2.1.0", - "postman-collection": "4.5.0", - "postman-request": "2.88.1-postman.39", - "postman-sandbox": "5.1.1", + "postman-collection": "4.4.0", + "postman-request": "2.88.1-postman.34", + "postman-sandbox": "4.7.1", "postman-url-encoder": "3.0.5", "serialised-error": "1.1.3", "strip-json-comments": "3.1.1", "uuid": "8.3.2" }, "engines": { - "node": ">=16" - } - }, - "node_modules/postman-runtime/node_modules/postman-collection": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.5.0.tgz", - "integrity": "sha512-152JSW9pdbaoJihwjc7Q8lc3nPg/PC9lPTHdMk7SHnHhu/GBJB7b2yb9zG7Qua578+3PxkQ/HYBuXpDSvsf7GQ==", - "dependencies": { - "@faker-js/faker": "5.5.3", - "file-type": "3.9.0", - "http-reasons": "0.1.0", - "iconv-lite": "0.6.3", - "liquid-json": "0.3.1", - "lodash": "4.17.21", - "mime-format": "2.0.1", - "mime-types": "2.1.35", - "postman-url-encoder": "3.0.5", - "semver": "7.6.3", - "uuid": "8.3.2" - }, - "engines": { - "node": ">=10" + "node": ">=12" } }, - "node_modules/postman-runtime/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } + "node_modules/postman-runtime/node_modules/aws4": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "node_modules/postman-sandbox": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postman-sandbox/-/postman-sandbox-5.1.1.tgz", - "integrity": "sha512-RfCTMwz3OaqhYYgtoe3VlHGiQl9hEmJ9sPh/XOlNcuvd/km6ARSFkKXFvQaLFsTHyXcHaqpInKaQSJi23uTynA==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/postman-sandbox/-/postman-sandbox-4.7.1.tgz", + "integrity": "sha512-H2wYSLK0mB588IaxoLrLoPbpmxsIcwFtgaK2c8gAsAQ+TgYFePwb4qdeVcYDMqmwrLd77/ViXkjasP/sBMz1sQ==", "dependencies": { "lodash": "4.17.21", - "postman-collection": "4.5.0", + "postman-collection": "4.4.0", "teleport-javascript": "1.0.0", - "uvm": "3.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/postman-sandbox/node_modules/postman-collection": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.5.0.tgz", - "integrity": "sha512-152JSW9pdbaoJihwjc7Q8lc3nPg/PC9lPTHdMk7SHnHhu/GBJB7b2yb9zG7Qua578+3PxkQ/HYBuXpDSvsf7GQ==", - "dependencies": { - "@faker-js/faker": "5.5.3", - "file-type": "3.9.0", - "http-reasons": "0.1.0", - "iconv-lite": "0.6.3", - "liquid-json": "0.3.1", - "lodash": "4.17.21", - "mime-format": "2.0.1", - "mime-types": "2.1.35", - "postman-url-encoder": "3.0.5", - "semver": "7.6.3", - "uuid": "8.3.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/postman-sandbox/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "bin": { - "semver": "bin/semver.js" + "uvm": "2.1.1" }, "engines": { "node": ">=10" @@ -8448,16 +8369,21 @@ } }, "node_modules/uvm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uvm/-/uvm-3.0.0.tgz", - "integrity": "sha512-dATVpxsNfFBpHNdq6sy4/CV2UnoRbV8tvvkK0VrUPnm+o7dK6fnir4LEm8czeDdpbw2KKDKjIPcRSZY4AEwEZA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/uvm/-/uvm-2.1.1.tgz", + "integrity": "sha512-BZ5w8adTpNNr+zczOBRpaX/hH8UPKAf7fmCnidrcsqt3bn8KT9bDIfuS7hgRU9RXgiN01su2pwysBONY6w8W5w==", "dependencies": { - "flatted": "3.3.1" + "flatted": "3.2.6" }, "engines": { - "node": ">=16" + "node": ">=10" } }, + "node_modules/uvm/node_modules/flatted": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==" + }, "node_modules/v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", diff --git a/package.json b/package.json index 748ddbc3..e8b71bc4 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "fs-extra": "^10.1.0", "lodash": "^4.17.21", "neotraverse": "^0.6.15", - "newman": "^6.2.0", + "newman": "^6.2.1", "node-emoji": "^1.11.0", "openapi-format": "^1.22.3", "openapi-to-postmanv2": "4.24.0", From a1f1c3ee75625271802e7d9c6e8d51010fe2ca6b Mon Sep 17 00:00:00 2001 From: Thim Date: Tue, 27 Aug 2024 22:45:04 +0200 Subject: [PATCH 7/7] Updated changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5da0564..56d0a3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## [Unreleased] +- Improved OpenAPI to JSON schema conversion to handle OpenAPI-specific properties (#642 #494) +- strip unneeded OpenAPI-specific properties ('discriminator', 'readOnly', 'writeOnly', 'xml', 'externalDocs', 'example','deprecated') for more compact JSON schemas. +- Added JSON schema validation warning during conversion, to inform the users. (#644) +- Fix for unwanted minItems, maxItems addition in the JSON schema +- overwriteRequestQueryParams - Remove form encoded array query params ((#640)) +- overwriteRequestQueryParams - Insert additional form encoded array query params (#640) +- Bumped dependencies: newman + ## v1.30.0 - (2024-08-23) - Portman - sort Postman folders based on the "orderOfFolders" configuration (#621)