format.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. [
  2. {
  3. "description": "validation of date-time strings",
  4. "schema": {"format": "date-time"},
  5. "tests": [
  6. {
  7. "description": "a valid date-time string",
  8. "data": "1963-06-19T08:30:06.283185Z",
  9. "valid": true
  10. },
  11. {
  12. "description": "an invalid date-time string",
  13. "data": "06/19/1963 08:30:06 PST",
  14. "valid": false
  15. },
  16. {
  17. "description": "only RFC3339 not all of ISO 8601 are valid",
  18. "data": "2013-350T01:01:01",
  19. "valid": false
  20. }
  21. ]
  22. },
  23. {
  24. "description": "validation of URIs",
  25. "schema": {"format": "uri"},
  26. "tests": [
  27. {
  28. "description": "a valid URI",
  29. "data": "http://foo.bar/?baz=qux#quux",
  30. "valid": true
  31. },
  32. {
  33. "description": "a valid protocol-relative URI",
  34. "data": "//foo.bar/?baz=qux#quux",
  35. "valid": true
  36. },
  37. {
  38. "description": "an invalid URI",
  39. "data": "\\\\WINDOWS\\fileshare",
  40. "valid": false
  41. },
  42. {
  43. "description": "an invalid URI though valid URI reference",
  44. "data": "abc",
  45. "valid": false
  46. }
  47. ]
  48. },
  49. {
  50. "description": "validation of e-mail addresses",
  51. "schema": {"format": "email"},
  52. "tests": [
  53. {
  54. "description": "a valid e-mail address",
  55. "data": "joe.bloggs@example.com",
  56. "valid": true
  57. },
  58. {
  59. "description": "an invalid e-mail address",
  60. "data": "2962",
  61. "valid": false
  62. }
  63. ]
  64. },
  65. {
  66. "description": "validation of IP addresses",
  67. "schema": {"format": "ipv4"},
  68. "tests": [
  69. {
  70. "description": "a valid IP address",
  71. "data": "192.168.0.1",
  72. "valid": true
  73. },
  74. {
  75. "description": "an IP address with too many components",
  76. "data": "127.0.0.0.1",
  77. "valid": false
  78. },
  79. {
  80. "description": "an IP address with out-of-range values",
  81. "data": "256.256.256.256",
  82. "valid": false
  83. },
  84. {
  85. "description": "an IP address without 4 components",
  86. "data": "127.0",
  87. "valid": false
  88. },
  89. {
  90. "description": "an IP address as an integer",
  91. "data": "0x7f000001",
  92. "valid": false
  93. }
  94. ]
  95. },
  96. {
  97. "description": "validation of IPv6 addresses",
  98. "schema": {"format": "ipv6"},
  99. "tests": [
  100. {
  101. "description": "a valid IPv6 address",
  102. "data": "::1",
  103. "valid": true
  104. },
  105. {
  106. "description": "an IPv6 address with out-of-range values",
  107. "data": "12345::",
  108. "valid": false
  109. },
  110. {
  111. "description": "an IPv6 address with too many components",
  112. "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
  113. "valid": false
  114. },
  115. {
  116. "description": "an IPv6 address containing illegal characters",
  117. "data": "::laptop",
  118. "valid": false
  119. }
  120. ]
  121. },
  122. {
  123. "description": "validation of host names",
  124. "schema": {"format": "hostname"},
  125. "tests": [
  126. {
  127. "description": "a valid host name",
  128. "data": "www.example.com",
  129. "valid": true
  130. },
  131. {
  132. "description": "a host name starting with an illegal character",
  133. "data": "-a-host-name-that-starts-with--",
  134. "valid": false
  135. },
  136. {
  137. "description": "a host name containing illegal characters",
  138. "data": "not_a_valid_host_name",
  139. "valid": false
  140. },
  141. {
  142. "description": "a host name with a component too long",
  143. "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
  144. "valid": false
  145. }
  146. ]
  147. }
  148. ]