Skip to content

Commit

Permalink
fix(ui): Import > Postman v2 > path params not imported (fixes #293)
Browse files Browse the repository at this point in the history
  • Loading branch information
flawiddsouza committed Dec 26, 2024
1 parent 790c676 commit 4b35bd8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/ui/src/parsers/postman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ function handlePostmanV2CollectionItem(postmanCollectionItem: any, parentId: str
})
})

const pathParameters: RequestParam[] = []

const pathParams = 'url' in request.request && typeof request.request.url !== 'string' && 'variable' in request.request.url ? request.request.url.variable : []
pathParams.forEach((pathParam: any) => {
pathParameters.push({
name: pathParam.key,
value: pathParam.value,
description: pathParam.description,
disabled: pathParam.disabled
})
})

let url = ''

if('url' in request.request) {
Expand Down Expand Up @@ -258,6 +270,7 @@ function handlePostmanV2CollectionItem(postmanCollectionItem: any, parentId: str
body,
headers,
parameters,
pathParameters,
authentication,
description: 'description' in request.request ? request.request.description : undefined,
parentId,
Expand Down

0 comments on commit 4b35bd8

Please sign in to comment.