diff --git a/lib/utils/SchemaManager.js b/lib/utils/SchemaManager.js index 7071483b..856a43d7 100644 --- a/lib/utils/SchemaManager.js +++ b/lib/utils/SchemaManager.js @@ -71,7 +71,9 @@ export default class SchemaManager { getMethodParams(methodPtr, resolveRefs) { /* inject JsonPointer into array elements */ function injectPointers(array, root) { - if (!array) return array; + if (!Array.isArray(array)) { + throw new Error(`parameters must be an array. Got ${typeof array} at ${root}`); + } return array.map((element, idx) => { element._pointer = JsonPointer.join(root, idx); return element;