From 4b35bd81dff7ea468320cc58e81cbb7ef3233a6a Mon Sep 17 00:00:00 2001 From: Flawid DSouza Date: Thu, 26 Dec 2024 17:25:26 +0530 Subject: [PATCH] fix(ui): Import > Postman v2 > path params not imported (fixes #293) --- packages/ui/src/parsers/postman.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/ui/src/parsers/postman.ts b/packages/ui/src/parsers/postman.ts index b68c8a06..d3a661c7 100644 --- a/packages/ui/src/parsers/postman.ts +++ b/packages/ui/src/parsers/postman.ts @@ -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) { @@ -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,