From afaf4e62d8a7935b55b58d70ab0acb4b60925bf3 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 23 Jul 2024 08:26:00 -0700 Subject: [PATCH] Better body handling in Postman --- plugins/importer-openapi/src/index.ts | 2 ++ plugins/importer-postman/src/index.ts | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/importer-openapi/src/index.ts b/plugins/importer-openapi/src/index.ts index 8ba281a8..ee1cc66f 100644 --- a/plugins/importer-openapi/src/index.ts +++ b/plugins/importer-openapi/src/index.ts @@ -31,5 +31,7 @@ export async function pluginHookImport( return undefined; } + // console.log("HELLO", JSON.stringify(postmanCollection, null, 1)); + return pluginHookImportPostman(ctx, JSON.stringify(postmanCollection)); } diff --git a/plugins/importer-postman/src/index.ts b/plugins/importer-postman/src/index.ts index 57263d2a..f946ce8b 100644 --- a/plugins/importer-postman/src/index.ts +++ b/plugins/importer-postman/src/index.ts @@ -168,7 +168,7 @@ function importAuth( function importBody(rawBody: any): Pick { const body = toRecord(rawBody); - if ('graphql' in body) { + if (body.mode === 'graphql') { return { headers: [ { @@ -186,7 +186,7 @@ function importBody(rawBody: any): Pick