mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
Add extra check to SchemaManager
This commit is contained in:
parent
5b32d31d13
commit
4af37bbd09
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user