Fix undefined id causing improper import (#1302)

Fix undefined id causing improper import
This commit is contained in:
Timothy Lim 2018-12-12 07:29:10 -08:00 committed by Gregory Schier
parent 931f01c447
commit 7bdd40892d

View File

@ -122,8 +122,9 @@ function parseEndpoints(document) {
let { tags } = endpointSchema; let { tags } = endpointSchema;
if (!tags || tags.length == 0) tags = ['']; if (!tags || tags.length == 0) tags = [''];
tags.forEach((tag, index) => { tags.forEach((tag, index) => {
let id = let id = endpointSchema.operationId
endpointSchema.operationId + (index > 0 ? index : '') || `__REQUEST_${requestCount++}__`; ? `${endpointSchema.operationId}${index > 0 ? index : ''}`
: `__REQUEST_${requestCount++}__`;
let parentId = folderLookup[tag] || defaultParent; let parentId = folderLookup[tag] || defaultParent;
requests.push(importRequest(endpointSchema, globalMimeTypes, id, parentId)); requests.push(importRequest(endpointSchema, globalMimeTypes, id, parentId));
}); });