JAL-1641 biojson documentation with docson
[jalview.git] / examples / biojson-doc / tests / maxItems.json
diff --git a/examples/biojson-doc/tests/maxItems.json b/examples/biojson-doc/tests/maxItems.json
new file mode 100755 (executable)
index 0000000..3b53a6b
--- /dev/null
@@ -0,0 +1,28 @@
+[
+    {
+        "description": "maxItems validation",
+        "schema": {"maxItems": 2},
+        "tests": [
+            {
+                "description": "shorter is valid",
+                "data": [1],
+                "valid": true
+            },
+            {
+                "description": "exact length is valid",
+                "data": [1, 2],
+                "valid": true
+            },
+            {
+                "description": "too long is invalid",
+                "data": [1, 2, 3],
+                "valid": false
+            },
+            {
+                "description": "ignores non-arrays",
+                "data": "foobar",
+                "valid": true
+            }
+        ]
+    }
+]