diff --git a/base/schema-pike/test/inputs/schema/min-max-items.schema/default/TopLevel.pmod b/head/schema-pike/test/inputs/schema/min-max-items.schema/default/TopLevel.pmod
index 138bdfc..c0f2802 100644
--- a/base/schema-pike/test/inputs/schema/min-max-items.schema/default/TopLevel.pmod
+++ b/head/schema-pike/test/inputs/schema/min-max-items.schema/default/TopLevel.pmod
@@ -35,10 +35,15 @@ class TopLevel {
 TopLevel TopLevel_from_JSON(mixed json) {
     TopLevel retval = TopLevel();
 
+    if (sizeof(json["maxOnly"]) > 3) error("Array too long");
     retval.max_only = json["maxOnly"];
+    if (sizeof(json["minAndMax"]) < 1) error("Array too short");
+    if (sizeof(json["minAndMax"]) > 4) error("Array too long");
     retval.min_and_max = json["minAndMax"];
+    if (sizeof(json["minOnly"]) < 2) error("Array too short");
     retval.min_only = json["minOnly"];
     retval.plain = json["plain"];
+    if (sizeof(json["unionItems"]) < 2) error("Array too short");
     retval.union_items = json["unionItems"];
 
     return retval;
diff --git a/base/schema-pike/test/inputs/schema/vega-lite.schema/default/TopLevel.pmod b/head/schema-pike/test/inputs/schema/vega-lite.schema/default/TopLevel.pmod
index be580f4..c299715 100644
--- a/base/schema-pike/test/inputs/schema/vega-lite.schema/default/TopLevel.pmod
+++ b/head/schema-pike/test/inputs/schema/vega-lite.schema/default/TopLevel.pmod
@@ -2636,13 +2636,17 @@ BinParams BinParams_from_JSON(mixed json) {
     BinParams retval = BinParams();
 
     retval.base = json["base"];
+    if (has_index(json, "divide") && sizeof(json["divide"]) < 1) error("Array too short");
     retval.divide = json["divide"];
+    if (has_index(json, "extent") && sizeof(json["extent"]) < 2) error("Array too short");
+    if (has_index(json, "extent") && sizeof(json["extent"]) > 2) error("Array too long");
     retval.extent = json["extent"];
     if (has_index(json, "maxbins") && json["maxbins"] < 2) error("Value below minimum");
     retval.maxbins = json["maxbins"];
     retval.minstep = json["minstep"];
     retval.nice = json["nice"];
     retval.step = json["step"];
+    if (has_index(json, "steps") && sizeof(json["steps"]) < 1) error("Array too short");
     retval.steps = json["steps"];
 
     return retval;
@@ -2783,6 +2787,8 @@ Predicate Predicate_from_JSON(mixed json) {
     retval.equal = json["equal"];
     retval.field = json["field"];
     retval.time_unit = TimeUnit_from_JSON(json["timeUnit"]);
+    if (has_index(json, "range") && sizeof(json["range"]) < 2) error("Array too short");
+    if (has_index(json, "range") && sizeof(json["range"]) > 2) error("Array too long");
     retval.range = json["range"];
     retval.one_of = json["oneOf"];
     if (arrayp(json["selection"])) error("Unexpected array");
