items.json 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. [
  2. {
  3. "description": "a schema given for items",
  4. "schema": {
  5. "items": {"type": "integer"}
  6. },
  7. "tests": [
  8. {
  9. "description": "valid items",
  10. "data": [ 1, 2, 3 ],
  11. "valid": true
  12. },
  13. {
  14. "description": "wrong type of items",
  15. "data": [1, "x"],
  16. "valid": false
  17. },
  18. {
  19. "description": "ignores non-arrays",
  20. "data": {"foo" : "bar"},
  21. "valid": true
  22. }
  23. ]
  24. },
  25. {
  26. "description": "an array of schemas for items",
  27. "schema": {
  28. "items": [
  29. {"type": "integer"},
  30. {"type": "string"}
  31. ]
  32. },
  33. "tests": [
  34. {
  35. "description": "correct types",
  36. "data": [ 1, "foo" ],
  37. "valid": true
  38. },
  39. {
  40. "description": "wrong types",
  41. "data": [ "foo", 1 ],
  42. "valid": false
  43. }
  44. ]
  45. }
  46. ]