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);
});
const folderLookup = {};
folders.forEach(folder => (folderLookup[folder.name] = folder._id));
for (const folder of folders) {
folderLookup[folder.name] = folder._id;
}
const requests = [];
endpointsSchemas.map(endpointSchema => {
@ -427,9 +430,11 @@ function generateParameterExample(schema) {
const example = {};
const { properties } = schema;
Object.keys(properties).forEach(propertyName => {
example[propertyName] = generateParameterExample(properties[propertyName]);
});
if (properties) {
for (const propertyName of Object.keys(properties)) {
example[propertyName] = generateParameterExample(properties[propertyName]);
}
}
return example;
},