mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +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) {
|
getMethodParams(methodPtr, resolveRefs) {
|
||||||
/* inject JsonPointer into array elements */
|
/* inject JsonPointer into array elements */
|
||||||
function injectPointers(array, root) {
|
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) => {
|
return array.map((element, idx) => {
|
||||||
element._pointer = JsonPointer.join(root, idx);
|
element._pointer = JsonPointer.join(root, idx);
|
||||||
return element;
|
return element;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user