From 8b1dd63e8bd179ecdf91aec9330ed4825b260238 Mon Sep 17 00:00:00 2001 From: RupengLiu Date: Tue, 16 Mar 2021 18:39:02 -0700 Subject: [PATCH] Fix open api serviceurl (#187) --- src/explorer/editors/openApi/OpenApiEditor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/explorer/editors/openApi/OpenApiEditor.ts b/src/explorer/editors/openApi/OpenApiEditor.ts index 0758781..d40d909 100644 --- a/src/explorer/editors/openApi/OpenApiEditor.ts +++ b/src/explorer/editors/openApi/OpenApiEditor.ts @@ -56,7 +56,9 @@ export class OpenApiEditor extends Editor { const openApiparser = new OpenApiParser(); openApiDocument = await openApiparser.parse(documentJson); - openApiparser.updateBackend(openApiDocument.sourceDocument, nonNullProp(context.apiContract, 'serviceUrl')); + if (context.apiContract.serviceUrl !== null && context.apiContract.serviceUrl !== undefined) { + openApiparser.updateBackend(openApiDocument.sourceDocument, nonNullProp(context.apiContract, 'serviceUrl')); + } const swaggerJson = JSON.stringify(openApiDocument.sourceDocument); const payload: ApiManagementModels.ApiCreateOrUpdateParameter = {