OpenAPI spec check for empty properties on import

This commit is contained in:
Gregory Schier 2019-11-22 10:57:33 -05:00
parent 62f3899e23
commit af3a4f0553

View File

@ -132,7 +132,10 @@ function parseEndpoints(document) {
return importFolderItem(tag, defaultParent); return importFolderItem(tag, defaultParent);
}); });
const folderLookup = {}; const folderLookup = {};
folders.forEach(folder => (folderLookup[folder.name] = folder._id));
for (const folder of folders) {
folderLookup[folder.name] = folder._id;
}
const requests = []; const requests = [];
endpointsSchemas.map(endpointSchema => { endpointsSchemas.map(endpointSchema => {
@ -427,9 +430,11 @@ function generateParameterExample(schema) {
const example = {}; const example = {};
const { properties } = schema; const { properties } = schema;
Object.keys(properties).forEach(propertyName => { if (properties) {
example[propertyName] = generateParameterExample(properties[propertyName]); for (const propertyName of Object.keys(properties)) {
}); example[propertyName] = generateParameterExample(properties[propertyName]);
}
}
return example; return example;
}, },