PageRenderTime 66ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/JsonSchemaValidator/draft-04/JSON Schema: interactive and non interactive validation.html

https://bitbucket.org/nut_code_monkey/jsonschemavalidator
HTML | 1050 lines | 785 code | 133 blank | 132 comment | 0 complexity | d9fcc948ce83acac1447485162350ff3 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html lang="en"><head><title>JSON Schema: interactive and non interactive validation</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <meta name="description" content="JSON Schema: interactive and non interactive validation">
  5. <meta name="keywords" content="JSON, Schema, validation">
  6. <meta name="generator" content="xml2rfc v1.36 (http://xml.resource.org/)">
  7. <style type='text/css'><!--
  8. body {
  9. font-family: verdana, charcoal, helvetica, arial, sans-serif;
  10. font-size: small; color: #000; background-color: #FFF;
  11. margin: 2em;
  12. }
  13. h1, h2, h3, h4, h5, h6 {
  14. font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
  15. font-weight: bold; font-style: normal;
  16. }
  17. h1 { color: #900; background-color: transparent; text-align: right; }
  18. h3 { color: #333; background-color: transparent; }
  19. td.RFCbug {
  20. font-size: x-small; text-decoration: none;
  21. width: 30px; height: 30px; padding-top: 2px;
  22. text-align: justify; vertical-align: middle;
  23. background-color: #000;
  24. }
  25. td.RFCbug span.RFC {
  26. font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
  27. font-weight: bold; color: #666;
  28. }
  29. td.RFCbug span.hotText {
  30. font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
  31. font-weight: normal; text-align: center; color: #FFF;
  32. }
  33. table.TOCbug { width: 30px; height: 15px; }
  34. td.TOCbug {
  35. text-align: center; width: 30px; height: 15px;
  36. color: #FFF; background-color: #900;
  37. }
  38. td.TOCbug a {
  39. font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
  40. font-weight: bold; font-size: x-small; text-decoration: none;
  41. color: #FFF; background-color: transparent;
  42. }
  43. td.header {
  44. font-family: arial, helvetica, sans-serif; font-size: x-small;
  45. vertical-align: top; width: 33%;
  46. color: #FFF; background-color: #666;
  47. }
  48. td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
  49. td.author-text { font-size: x-small; }
  50. /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
  51. a.info {
  52. /* This is the key. */
  53. position: relative;
  54. z-index: 24;
  55. text-decoration: none;
  56. }
  57. a.info:hover {
  58. z-index: 25;
  59. color: #FFF; background-color: #900;
  60. }
  61. a.info span { display: none; }
  62. a.info:hover span.info {
  63. /* The span will display just on :hover state. */
  64. display: block;
  65. position: absolute;
  66. font-size: smaller;
  67. top: 2em; left: -5em; width: 15em;
  68. padding: 2px; border: 1px solid #333;
  69. color: #900; background-color: #EEE;
  70. text-align: left;
  71. }
  72. a { font-weight: bold; }
  73. a:link { color: #900; background-color: transparent; }
  74. a:visited { color: #633; background-color: transparent; }
  75. a:active { color: #633; background-color: transparent; }
  76. p { margin-left: 2em; margin-right: 2em; }
  77. p.copyright { font-size: x-small; }
  78. p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
  79. table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
  80. td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }
  81. ol.text { margin-left: 2em; margin-right: 2em; }
  82. ul.text { margin-left: 2em; margin-right: 2em; }
  83. li { margin-left: 3em; }
  84. /* RFC-2629 <spanx>s and <artwork>s. */
  85. em { font-style: italic; }
  86. strong { font-weight: bold; }
  87. dfn { font-weight: bold; font-style: normal; }
  88. cite { font-weight: normal; font-style: normal; }
  89. tt { color: #036; }
  90. tt, pre, pre dfn, pre em, pre cite, pre span {
  91. font-family: "Courier New", Courier, monospace; font-size: small;
  92. }
  93. pre {
  94. text-align: left; padding: 4px;
  95. color: #000; background-color: #CCC;
  96. }
  97. pre dfn { color: #900; }
  98. pre em { color: #66F; background-color: #FFC; font-weight: normal; }
  99. pre .key { color: #33C; font-weight: bold; }
  100. pre .id { color: #900; }
  101. pre .str { color: #000; background-color: #CFF; }
  102. pre .val { color: #066; }
  103. pre .rep { color: #909; }
  104. pre .oth { color: #000; background-color: #FCF; }
  105. pre .err { background-color: #FCC; }
  106. /* RFC-2629 <texttable>s. */
  107. table.all, table.full, table.headers, table.none {
  108. font-size: small; text-align: center; border-width: 2px;
  109. vertical-align: top; border-collapse: collapse;
  110. }
  111. table.all, table.full { border-style: solid; border-color: black; }
  112. table.headers, table.none { border-style: none; }
  113. th {
  114. font-weight: bold; border-color: black;
  115. border-width: 2px 2px 3px 2px;
  116. }
  117. table.all th, table.full th { border-style: solid; }
  118. table.headers th { border-style: none none solid none; }
  119. table.none th { border-style: none; }
  120. table.all td {
  121. border-style: solid; border-color: #333;
  122. border-width: 1px 2px;
  123. }
  124. table.full td, table.headers td, table.none td { border-style: none; }
  125. hr { height: 1px; }
  126. hr.insert {
  127. width: 80%; border-style: none; border-width: 0;
  128. color: #CCC; background-color: #CCC;
  129. }
  130. --></style>
  131. </head>
  132. <body>
  133. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  134. <table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
  135. <tr><td class="header">Internet Engineering Task Force</td><td class="header">fge. Galiegue</td></tr>
  136. <tr><td class="header">Internet-Draft</td><td class="header">&nbsp;</td></tr>
  137. <tr><td class="header">Intended status: Informational</td><td class="header">K. Zyp, Ed.</td></tr>
  138. <tr><td class="header">Expires: August 3, 2013</td><td class="header">SitePen (USA)</td></tr>
  139. <tr><td class="header">&nbsp;</td><td class="header">G. Court</td></tr>
  140. <tr><td class="header">&nbsp;</td><td class="header">January 30, 2013</td></tr>
  141. </table></td></tr></table>
  142. <h1><br />JSON Schema: interactive and non interactive validation<br />json-schema-validation</h1>
  143. <h3>Abstract</h3>
  144. <p>
  145. JSON Schema (application/schema+json) has several purposes, one of which is instance
  146. validation. The validation process may be interactive or non interactive. For
  147. instance, applications may use JSON Schema to build a user interface enabling
  148. interactive content generation in addition to user input checking, or validate data
  149. retrieved from various sources. This specification describes schema keywords
  150. dedicated to validation purposes.
  151. </p>
  152. <h3>Status of This Memo</h3>
  153. <p>
  154. This Internet-Draft is submitted in full
  155. conformance with the provisions of BCP&nbsp;78 and BCP&nbsp;79.</p>
  156. <p>
  157. Internet-Drafts are working documents of the Internet Engineering
  158. Task Force (IETF). Note that other groups may also distribute
  159. working documents as Internet-Drafts. The list of current
  160. Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
  161. <p>
  162. Internet-Drafts are draft documents valid for a maximum of six months
  163. and may be updated, replaced, or obsoleted by other documents at any time.
  164. It is inappropriate to use Internet-Drafts as reference material or to cite
  165. them other than as &ldquo;work in progress.&rdquo;</p>
  166. <p>
  167. This Internet-Draft will expire on August 3, 2013.</p>
  168. <h3>Copyright Notice</h3>
  169. <p>
  170. Copyright (c) 2013 IETF Trust and the persons identified as the
  171. document authors. All rights reserved.</p>
  172. <p>
  173. This document is subject to BCP 78 and the IETF Trust's Legal
  174. Provisions Relating to IETF Documents
  175. (http://trustee.ietf.org/license-info) in effect on the date of
  176. publication of this document. Please review these documents
  177. carefully, as they describe your rights and restrictions with respect
  178. to this document. Code Components extracted from this document must
  179. include Simplified BSD License text as described in Section 4.e of
  180. the Trust Legal Provisions and are provided without warranty as
  181. described in the Simplified BSD License.</p>
  182. <a name="toc"></a><br /><hr />
  183. <h3>Table of Contents</h3>
  184. <p class="toc">
  185. <a href="#anchor1">1.</a>&nbsp;
  186. Introduction<br />
  187. <a href="#anchor2">2.</a>&nbsp;
  188. Conventions and Terminology<br />
  189. <a href="#anchor3">3.</a>&nbsp;
  190. Interoperability considerations<br />
  191. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor4">3.1.</a>&nbsp;
  192. Validation of string instances<br />
  193. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor5">3.2.</a>&nbsp;
  194. Validation of numeric instances<br />
  195. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor6">3.3.</a>&nbsp;
  196. Regular expressions<br />
  197. <a href="#anchor7">4.</a>&nbsp;
  198. General validation considerations<br />
  199. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor8">4.1.</a>&nbsp;
  200. Keywords and instance primitive types<br />
  201. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor9">4.2.</a>&nbsp;
  202. Inter-dependent keywords<br />
  203. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor10">4.3.</a>&nbsp;
  204. Default values for missing keywords<br />
  205. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor11">4.4.</a>&nbsp;
  206. Validation of container instances<br />
  207. <a href="#anchor12">5.</a>&nbsp;
  208. Validation keywords sorted by instance types<br />
  209. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor13">5.1.</a>&nbsp;
  210. Validation keywords for numeric instances (number and integer)<br />
  211. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor14">5.1.1.</a>&nbsp;
  212. multipleOf<br />
  213. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor17">5.1.2.</a>&nbsp;
  214. maximum and exclusiveMaximum<br />
  215. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor21">5.1.3.</a>&nbsp;
  216. minimum and exclusiveMinimum<br />
  217. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor25">5.2.</a>&nbsp;
  218. Validation keywords for strings<br />
  219. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor26">5.2.1.</a>&nbsp;
  220. maxLength<br />
  221. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor29">5.2.2.</a>&nbsp;
  222. minLength<br />
  223. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor33">5.2.3.</a>&nbsp;
  224. pattern<br />
  225. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor36">5.3.</a>&nbsp;
  226. Validation keywords for arrays<br />
  227. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor37">5.3.1.</a>&nbsp;
  228. additionalItems and items<br />
  229. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor42">5.3.2.</a>&nbsp;
  230. maxItems<br />
  231. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor45">5.3.3.</a>&nbsp;
  232. minItems<br />
  233. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor49">5.3.4.</a>&nbsp;
  234. uniqueItems<br />
  235. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor53">5.4.</a>&nbsp;
  236. Validation keywords for objects<br />
  237. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor54">5.4.1.</a>&nbsp;
  238. maxProperties<br />
  239. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor57">5.4.2.</a>&nbsp;
  240. minProperties<br />
  241. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor61">5.4.3.</a>&nbsp;
  242. required<br />
  243. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor64">5.4.4.</a>&nbsp;
  244. additionalProperties, properties and patternProperties<br />
  245. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor70">5.4.5.</a>&nbsp;
  246. dependencies<br />
  247. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor75">5.5.</a>&nbsp;
  248. Validation keywords for any instance type<br />
  249. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor76">5.5.1.</a>&nbsp;
  250. enum<br />
  251. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor79">5.5.2.</a>&nbsp;
  252. type<br />
  253. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor82">5.5.3.</a>&nbsp;
  254. allOf<br />
  255. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor85">5.5.4.</a>&nbsp;
  256. anyOf<br />
  257. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor88">5.5.5.</a>&nbsp;
  258. oneOf<br />
  259. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor91">5.5.6.</a>&nbsp;
  260. not<br />
  261. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor94">5.5.7.</a>&nbsp;
  262. definitions<br />
  263. <a href="#anchor97">6.</a>&nbsp;
  264. Metadata keywords<br />
  265. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor98">6.1.</a>&nbsp;
  266. "title" and "description"<br />
  267. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor99">6.1.1.</a>&nbsp;
  268. Valid values<br />
  269. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor100">6.1.2.</a>&nbsp;
  270. Purpose<br />
  271. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor101">6.2.</a>&nbsp;
  272. "default"<br />
  273. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor102">6.2.1.</a>&nbsp;
  274. Valid values<br />
  275. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor103">6.2.2.</a>&nbsp;
  276. Purpose<br />
  277. <a href="#anchor104">7.</a>&nbsp;
  278. Semantic validation with "format"<br />
  279. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor105">7.1.</a>&nbsp;
  280. Foreword<br />
  281. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor106">7.2.</a>&nbsp;
  282. Implementation requirements<br />
  283. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor107">7.3.</a>&nbsp;
  284. Defined attributes<br />
  285. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor108">7.3.1.</a>&nbsp;
  286. date-time<br />
  287. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor111">7.3.2.</a>&nbsp;
  288. email<br />
  289. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor114">7.3.3.</a>&nbsp;
  290. hostname<br />
  291. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor117">7.3.4.</a>&nbsp;
  292. ipv4<br />
  293. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor120">7.3.5.</a>&nbsp;
  294. ipv6<br />
  295. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor123">7.3.6.</a>&nbsp;
  296. uri<br />
  297. <a href="#anchor126">8.</a>&nbsp;
  298. Reference algorithms for calculating children schemas<br />
  299. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor127">8.1.</a>&nbsp;
  300. Foreword<br />
  301. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor128">8.2.</a>&nbsp;
  302. Array elements<br />
  303. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor129">8.2.1.</a>&nbsp;
  304. Defining characteristic<br />
  305. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor130">8.2.2.</a>&nbsp;
  306. Implied keywords and default values.<br />
  307. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor131">8.2.3.</a>&nbsp;
  308. Calculation<br />
  309. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor134">8.3.</a>&nbsp;
  310. Object members<br />
  311. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor135">8.3.1.</a>&nbsp;
  312. Defining characteristic<br />
  313. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor136">8.3.2.</a>&nbsp;
  314. Implied keywords<br />
  315. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#anchor137">8.3.3.</a>&nbsp;
  316. Calculation<br />
  317. <a href="#anchor142">9.</a>&nbsp;
  318. IANA Considerations<br />
  319. <a href="#rfc.references1">10.</a>&nbsp;
  320. References<br />
  321. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#rfc.references1">10.1.</a>&nbsp;
  322. Normative References<br />
  323. &nbsp;&nbsp;&nbsp;&nbsp;<a href="#rfc.references2">10.2.</a>&nbsp;
  324. Informative References<br />
  325. <a href="#anchor145">Appendix&nbsp;A.</a>&nbsp;
  326. ChangeLog<br />
  327. </p>
  328. <br clear="all" />
  329. <a name="anchor1"></a><br /><hr />
  330. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  331. <a name="rfc.section.1"></a><h3>1.&nbsp;
  332. Introduction</h3>
  333. <p>
  334. JSON Schema can be used to require that a given JSON document (an instance)
  335. satisfies a certain number of criteria. These criteria are materialized by a set of
  336. keywords which are described in this specification. In addition, a set of keywords
  337. is defined to assist in interactive instance generation. Those are also described in
  338. this specification.
  339. </p>
  340. <p>
  341. This specification will use the terminology defined by the JSON Schema core
  342. specification. It is advised that readers have a copy of this specification.
  343. </p>
  344. <a name="anchor2"></a><br /><hr />
  345. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  346. <a name="rfc.section.2"></a><h3>2.&nbsp;
  347. Conventions and Terminology</h3>
  348. <p>
  349. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
  350. "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
  351. interpreted as described in <a class='info' href='#RFC2119'>RFC 2119<span> (</span><span class='info'>Bradner, S., &ldquo;Key words for use in RFCs to Indicate Requirement Levels,&rdquo; March&nbsp;1997.</span><span>)</span></a> [RFC2119].
  352. </p>
  353. <p>
  354. This specification uses the term "container instance" to refer to both array and
  355. object instances. It uses the term "children instances" to refer to array elements
  356. or object member values.
  357. </p>
  358. <p>
  359. This specification uses the term "property set" to refer to the set of an object's
  360. member names; for instance, the property set of JSON Object { "a": 1, "b": 2 } is [
  361. "a", "b" ].
  362. </p>
  363. <p>
  364. Elements in an array value are said to be unique if no two elements of this array
  365. are equal, as defined by the core specification.
  366. </p>
  367. <a name="anchor3"></a><br /><hr />
  368. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  369. <a name="rfc.section.3"></a><h3>3.&nbsp;
  370. Interoperability considerations</h3>
  371. <a name="anchor4"></a><br /><hr />
  372. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  373. <a name="rfc.section.3.1"></a><h3>3.1.&nbsp;
  374. Validation of string instances</h3>
  375. <p>
  376. It should be noted that the nul character (\x00) is valid in a JSON string. An
  377. instance to validate may contain a string value with this character, regardless
  378. of the ability of the underlying programming language to deal with such data.
  379. </p>
  380. <a name="anchor5"></a><br /><hr />
  381. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  382. <a name="rfc.section.3.2"></a><h3>3.2.&nbsp;
  383. Validation of numeric instances</h3>
  384. <p>
  385. The JSON specification does not define any bounds to the scale or precision of
  386. numeric values. JSON Schema does not define any such bounds either. This means
  387. that numeric instances processed by JSON Schema can be arbitrarily large and/or
  388. have an arbitrarily large decimal part, regardless of the ability of the
  389. underlying programming language to deal with such data.
  390. </p>
  391. <a name="anchor6"></a><br /><hr />
  392. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  393. <a name="rfc.section.3.3"></a><h3>3.3.&nbsp;
  394. Regular expressions</h3>
  395. <p>
  396. Two validation keywords, "pattern" and "patternProperties", use regular
  397. expressions to express constraints. These regular expressions SHOULD
  398. be valid according to the <a class='info' href='#ecma262'>ECMA 262<span> (</span><span class='info'>, &ldquo;ECMA 262 specification,&rdquo; .</span><span>)</span></a> [ecma262] regular
  399. expression dialect.
  400. </p>
  401. <p>
  402. Furthermore, given the high disparity in regular expression constructs support,
  403. schema authors SHOULD limit themselves to the following regular expression
  404. tokens:
  405. </p>
  406. <blockquote class="text">
  407. <p>individual Unicode characters, as defined by the <a class='info' href='#RFC4627'>JSON specification<span> (</span><span class='info'>Crockford, D., &ldquo;The application/json Media Type for JavaScript Object Notation (JSON),&rdquo; July&nbsp;2006.</span><span>)</span></a> [RFC4627];
  408. </p>
  409. <p>simple character classes ([abc]), range character classes ([a-z]);
  410. </p>
  411. <p>complemented character classes ([^abc], [^a-z]);
  412. </p>
  413. <p>simple quantifiers: "+" (one or more), "*" (zero or more), "?" (zero or
  414. one), and their lazy versions ("+?", "*?", "??");
  415. </p>
  416. <p>range quantifiers: "{x}" (exactly x occurrences), "{x,y}" (at least x, at
  417. most y, occurrences), {x,} (x occurrences or more), and their lazy
  418. versions;
  419. </p>
  420. <p>the beginning-of-input ("^") and end-of-input ("$") anchors;
  421. </p>
  422. <p>simple grouping ("(...)") and alternation ("|").
  423. </p>
  424. </blockquote><p>
  425. </p>
  426. <p>
  427. Finally, implementations MUST NOT consider that regular expressions are
  428. anchored, neither at the beginning nor at the end. This means, for instance,
  429. that "es" matches "expression".
  430. </p>
  431. <a name="anchor7"></a><br /><hr />
  432. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  433. <a name="rfc.section.4"></a><h3>4.&nbsp;
  434. General validation considerations</h3>
  435. <a name="anchor8"></a><br /><hr />
  436. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  437. <a name="rfc.section.4.1"></a><h3>4.1.&nbsp;
  438. Keywords and instance primitive types</h3>
  439. <p>
  440. Some validation keywords only apply to one or more primitive types. When the
  441. primitive type of the instance cannot be validated by a given keyword,
  442. validation for this keyword and instance SHOULD succeed.
  443. </p>
  444. <p>
  445. This specification groups keywords in different sections, according to the
  446. primitive type, or types, these keywords validate. Note that some keywords
  447. validate all instance types.
  448. </p>
  449. <a name="anchor9"></a><br /><hr />
  450. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  451. <a name="rfc.section.4.2"></a><h3>4.2.&nbsp;
  452. Inter-dependent keywords</h3>
  453. <p>
  454. In order to validate an instance, some keywords are influenced by the presence
  455. (or absence) of other keywords. In this case, all these keywords will be grouped
  456. in the same section.
  457. </p>
  458. <a name="anchor10"></a><br /><hr />
  459. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  460. <a name="rfc.section.4.3"></a><h3>4.3.&nbsp;
  461. Default values for missing keywords</h3>
  462. <p>
  463. Some keywords, if absent, MAY be regarded by implementations as having
  464. a default value. In this case, the default value will be mentioned.
  465. </p>
  466. <a name="anchor11"></a><br /><hr />
  467. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  468. <a name="rfc.section.4.4"></a><h3>4.4.&nbsp;
  469. Validation of container instances</h3>
  470. <p>
  471. Keywords with the possibility to validate container instances (arrays or
  472. objects) only validate the instances themselves and not their children (array
  473. items or object properties). Some of these keywords do, however, contain
  474. information which is necessary for calculating which schema(s) a child must be
  475. valid against. The algorithms to calculate a child instance's relevant schema(s)
  476. are explained in a separate section.
  477. </p>
  478. <p>
  479. It should be noted that while an array element will only have to validate
  480. against one schema, object member values may have to validate against more than
  481. one schema.
  482. </p>
  483. <a name="anchor12"></a><br /><hr />
  484. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  485. <a name="rfc.section.5"></a><h3>5.&nbsp;
  486. Validation keywords sorted by instance types</h3>
  487. <a name="anchor13"></a><br /><hr />
  488. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  489. <a name="rfc.section.5.1"></a><h3>5.1.&nbsp;
  490. Validation keywords for numeric instances (number and integer)</h3>
  491. <a name="anchor14"></a><br /><hr />
  492. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  493. <a name="rfc.section.5.1.1"></a><h3>5.1.1.&nbsp;
  494. multipleOf</h3>
  495. <a name="anchor15"></a><br /><hr />
  496. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  497. <a name="rfc.section.5.1.1.1"></a><h3>5.1.1.1.&nbsp;
  498. Valid values</h3>
  499. <p>
  500. The value of "multipleOf" MUST be a JSON number. This number MUST be
  501. strictly greater than 0.
  502. </p>
  503. <a name="anchor16"></a><br /><hr />
  504. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  505. <a name="rfc.section.5.1.1.2"></a><h3>5.1.1.2.&nbsp;
  506. Conditions for successful validation</h3>
  507. <p>
  508. A numeric instance is valid against "multipleOf" if the
  509. result of the division of the instance by this keyword's value is
  510. an integer.
  511. </p>
  512. <a name="anchor17"></a><br /><hr />
  513. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  514. <a name="rfc.section.5.1.2"></a><h3>5.1.2.&nbsp;
  515. maximum and exclusiveMaximum</h3>
  516. <a name="anchor18"></a><br /><hr />
  517. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  518. <a name="rfc.section.5.1.2.1"></a><h3>5.1.2.1.&nbsp;
  519. Valid values</h3>
  520. <p>
  521. The value of "maximum" MUST be a JSON number. The value of
  522. "exclusiveMaximum" MUST be a boolean.
  523. </p>
  524. <p>
  525. If "exclusiveMaximum" is present, "maximum" MUST also be present.
  526. </p>
  527. <a name="anchor19"></a><br /><hr />
  528. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  529. <a name="rfc.section.5.1.2.2"></a><h3>5.1.2.2.&nbsp;
  530. Conditions for successful validation</h3>
  531. <p>
  532. Successful validation depends on the presence and value of
  533. "exclusiveMaximum":
  534. </p>
  535. <blockquote class="text">
  536. <p>if "exclusiveMaximum" is not present, or has boolean value false,
  537. then the instance is valid if it is lower than, or equal to, the
  538. value of "maximum";
  539. </p>
  540. <p>if "exclusiveMaximum" has boolean value true, the instance is
  541. valid if it is strictly lower than the value of "maximum".
  542. </p>
  543. </blockquote><p>
  544. </p>
  545. <a name="anchor20"></a><br /><hr />
  546. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  547. <a name="rfc.section.5.1.2.3"></a><h3>5.1.2.3.&nbsp;
  548. Default value</h3>
  549. <p>
  550. "exclusiveMaximum", if absent, may be considered as being present with
  551. boolean value false.
  552. </p>
  553. <a name="anchor21"></a><br /><hr />
  554. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  555. <a name="rfc.section.5.1.3"></a><h3>5.1.3.&nbsp;
  556. minimum and exclusiveMinimum</h3>
  557. <a name="anchor22"></a><br /><hr />
  558. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  559. <a name="rfc.section.5.1.3.1"></a><h3>5.1.3.1.&nbsp;
  560. Valid values</h3>
  561. <p>
  562. The value of "minimum" MUST be a JSON number. The value of
  563. "exclusiveMinimum" MUST be a boolean.
  564. </p>
  565. <p>
  566. If "exclusiveMinimum" is present, "minimum" MUST also be present.
  567. </p>
  568. <a name="anchor23"></a><br /><hr />
  569. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  570. <a name="rfc.section.5.1.3.2"></a><h3>5.1.3.2.&nbsp;
  571. Conditions for successful validation</h3>
  572. <p>
  573. Successful validation depends on the presence and value of
  574. "exclusiveMinimum":
  575. </p>
  576. <blockquote class="text">
  577. <p>if "exclusiveMinimum" is not present, or has boolean value false,
  578. then the instance is valid if it is greater than, or equal to, the
  579. value of "minimum";
  580. </p>
  581. <p>if "exclusiveMinimum" is present and has boolean value true, the
  582. instance is valid if it is strictly greater than the value of
  583. "minimum".
  584. </p>
  585. </blockquote><p>
  586. </p>
  587. <a name="anchor24"></a><br /><hr />
  588. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  589. <a name="rfc.section.5.1.3.3"></a><h3>5.1.3.3.&nbsp;
  590. Default value</h3>
  591. <p>
  592. "exclusiveMinimum", if absent, may be considered as being present with
  593. boolean value false.
  594. </p>
  595. <a name="anchor25"></a><br /><hr />
  596. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  597. <a name="rfc.section.5.2"></a><h3>5.2.&nbsp;
  598. Validation keywords for strings</h3>
  599. <a name="anchor26"></a><br /><hr />
  600. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  601. <a name="rfc.section.5.2.1"></a><h3>5.2.1.&nbsp;
  602. maxLength</h3>
  603. <a name="anchor27"></a><br /><hr />
  604. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  605. <a name="rfc.section.5.2.1.1"></a><h3>5.2.1.1.&nbsp;
  606. Valid values</h3>
  607. <p>
  608. The value of this keyword MUST be an integer. This integer MUST be
  609. greater than, or equal to, 0.
  610. </p>
  611. <a name="anchor28"></a><br /><hr />
  612. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  613. <a name="rfc.section.5.2.1.2"></a><h3>5.2.1.2.&nbsp;
  614. Conditions for successful validation</h3>
  615. <p>
  616. A string instance is valid against this keyword if its
  617. length is less than, or equal to, the value of this keyword.
  618. </p>
  619. <p>
  620. The length of a string instance is defined as the number of its
  621. characters as defined by <a class='info' href='#RFC4627'>RFC 4627<span> (</span><span class='info'>Crockford, D., &ldquo;The application/json Media Type for JavaScript Object Notation (JSON),&rdquo; July&nbsp;2006.</span><span>)</span></a> [RFC4627].
  622. </p>
  623. <a name="anchor29"></a><br /><hr />
  624. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  625. <a name="rfc.section.5.2.2"></a><h3>5.2.2.&nbsp;
  626. minLength</h3>
  627. <a name="anchor30"></a><br /><hr />
  628. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  629. <a name="rfc.section.5.2.2.1"></a><h3>5.2.2.1.&nbsp;
  630. Valid values</h3>
  631. <p>
  632. The value of this keyword MUST be an integer. This integer MUST be
  633. greater than, or equal to, 0.
  634. </p>
  635. <a name="anchor31"></a><br /><hr />
  636. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  637. <a name="rfc.section.5.2.2.2"></a><h3>5.2.2.2.&nbsp;
  638. Conditions for successful validation</h3>
  639. <p>
  640. A string instance is valid against this keyword if its
  641. length is greater than, or equal to, the value of this keyword.
  642. </p>
  643. <p>
  644. The length of a string instance is defined as the number of its
  645. characters as defined by <a class='info' href='#RFC4627'>RFC 4627<span> (</span><span class='info'>Crockford, D., &ldquo;The application/json Media Type for JavaScript Object Notation (JSON),&rdquo; July&nbsp;2006.</span><span>)</span></a> [RFC4627].
  646. </p>
  647. <a name="anchor32"></a><br /><hr />
  648. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  649. <a name="rfc.section.5.2.2.3"></a><h3>5.2.2.3.&nbsp;
  650. Default value</h3>
  651. <p>
  652. "minLength", if absent, may be considered as being present with integer
  653. value 0.
  654. </p>
  655. <a name="anchor33"></a><br /><hr />
  656. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  657. <a name="rfc.section.5.2.3"></a><h3>5.2.3.&nbsp;
  658. pattern</h3>
  659. <a name="anchor34"></a><br /><hr />
  660. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  661. <a name="rfc.section.5.2.3.1"></a><h3>5.2.3.1.&nbsp;
  662. Valid values</h3>
  663. <p>
  664. The value of this keyword MUST be a string. This string SHOULD be a
  665. valid regular expression, according to the ECMA 262 regular expression
  666. dialect.
  667. </p>
  668. <a name="anchor35"></a><br /><hr />
  669. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  670. <a name="rfc.section.5.2.3.2"></a><h3>5.2.3.2.&nbsp;
  671. Conditions for successful validation</h3>
  672. <p>
  673. A string instance is considered valid if the regular
  674. expression matches the instance successfully. Recall: regular
  675. expressions are not implicitly anchored.
  676. </p>
  677. <a name="anchor36"></a><br /><hr />
  678. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  679. <a name="rfc.section.5.3"></a><h3>5.3.&nbsp;
  680. Validation keywords for arrays</h3>
  681. <a name="anchor37"></a><br /><hr />
  682. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  683. <a name="rfc.section.5.3.1"></a><h3>5.3.1.&nbsp;
  684. additionalItems and items</h3>
  685. <a name="anchor38"></a><br /><hr />
  686. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  687. <a name="rfc.section.5.3.1.1"></a><h3>5.3.1.1.&nbsp;
  688. Valid values</h3>
  689. <p>
  690. The value of "additionalItems" MUST be either a boolean or an object. If
  691. it is an object, this object MUST be a valid JSON Schema.
  692. </p>
  693. <p>
  694. The value of "items" MUST be either an object or an array. If it is an
  695. object, this object MUST be a valid JSON Schema. If it is an array,
  696. items of this array MUST be objects, and each of these objects MUST be a
  697. valid JSON Schema.
  698. </p>
  699. <a name="anchor39"></a><br /><hr />
  700. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  701. <a name="rfc.section.5.3.1.2"></a><h3>5.3.1.2.&nbsp;
  702. Conditions for successful validation</h3>
  703. <p>
  704. Successful validation of an array instance with regards to these two
  705. keywords is determined as follows:
  706. </p>
  707. <blockquote class="text">
  708. <p>if "items" is not present, or its value is an object, validation
  709. of the instance always succeeds, regardless of the value of
  710. "additionalItems";
  711. </p>
  712. <p>if the value of "additionalItems" is boolean value true or an
  713. object, validation of the instance always succeeds;
  714. </p>
  715. <p>if the value of "additionalItems" is boolean value false and the
  716. value of "items" is an array, the instance is valid if
  717. its size is less than, or equal to, the size of "items".
  718. </p>
  719. </blockquote><p>
  720. </p>
  721. <a name="anchor40"></a><br /><hr />
  722. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  723. <a name="rfc.section.5.3.1.3"></a><h3>5.3.1.3.&nbsp;
  724. Example</h3>
  725. <p>
  726. The following example covers the case where "additionalItems" has
  727. boolean value false and "items" is an array, since this is the only
  728. situation under which an instance may fail to validate successfully.
  729. </p>
  730. <p>This is an example schema:
  731. </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
  732. {
  733. "items": [ {}, {}, {} ],
  734. "additionalItems": false
  735. }
  736. </pre></div>
  737. <p>
  738. With this schema, the following instances are valid:
  739. </p>
  740. <blockquote class="text">
  741. <p>[] (an empty array),
  742. </p>
  743. <p>[ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ] ],
  744. </p>
  745. <p>[ 1, 2, 3 ];
  746. </p>
  747. </blockquote><p>
  748. </p>
  749. <p>
  750. the following instances are invalid:
  751. </p>
  752. <blockquote class="text">
  753. <p>[ 1, 2, 3, 4 ],
  754. </p>
  755. <p>[ null, { "a": "b" }, true, 31.000002020013 ]
  756. </p>
  757. </blockquote><p>
  758. </p>
  759. <a name="anchor41"></a><br /><hr />
  760. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  761. <a name="rfc.section.5.3.1.4"></a><h3>5.3.1.4.&nbsp;
  762. Default values</h3>
  763. <p>
  764. If either keyword is absent, it may be considered present with an empty
  765. schema.
  766. </p>
  767. <a name="anchor42"></a><br /><hr />
  768. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  769. <a name="rfc.section.5.3.2"></a><h3>5.3.2.&nbsp;
  770. maxItems</h3>
  771. <a name="anchor43"></a><br /><hr />
  772. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  773. <a name="rfc.section.5.3.2.1"></a><h3>5.3.2.1.&nbsp;
  774. Valid values</h3>
  775. <p>
  776. The value of this keyword MUST be an integer. This integer MUST be
  777. greater than, or equal to, 0.
  778. </p>
  779. <a name="anchor44"></a><br /><hr />
  780. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  781. <a name="rfc.section.5.3.2.2"></a><h3>5.3.2.2.&nbsp;
  782. Conditions for successful validation</h3>
  783. <p>
  784. An array instance is valid against "maxItems" if its size is
  785. less than, or equal to, the value of this keyword.
  786. </p>
  787. <a name="anchor45"></a><br /><hr />
  788. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  789. <a name="rfc.section.5.3.3"></a><h3>5.3.3.&nbsp;
  790. minItems</h3>
  791. <a name="anchor46"></a><br /><hr />
  792. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  793. <a name="rfc.section.5.3.3.1"></a><h3>5.3.3.1.&nbsp;
  794. Valid values</h3>
  795. <p>
  796. The value of this keyword MUST be an integer. This integer MUST be
  797. greater than, or equal to, 0.
  798. </p>
  799. <a name="anchor47"></a><br /><hr />
  800. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  801. <a name="rfc.section.5.3.3.2"></a><h3>5.3.3.2.&nbsp;
  802. Conditions for successful validation</h3>
  803. <p>
  804. An array instance is valid against "minItems" if its size is
  805. greater than, or equal to, the value of this keyword.
  806. </p>
  807. <a name="anchor48"></a><br /><hr />
  808. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  809. <a name="rfc.section.5.3.3.3"></a><h3>5.3.3.3.&nbsp;
  810. Default value</h3>
  811. <p>
  812. If this keyword is not present, it may be considered present with a
  813. value of 0.
  814. </p>
  815. <a name="anchor49"></a><br /><hr />
  816. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  817. <a name="rfc.section.5.3.4"></a><h3>5.3.4.&nbsp;
  818. uniqueItems</h3>
  819. <a name="anchor50"></a><br /><hr />
  820. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  821. <a name="rfc.section.5.3.4.1"></a><h3>5.3.4.1.&nbsp;
  822. Valid values</h3>
  823. <p>
  824. The value of this keyword MUST be a boolean.
  825. </p>
  826. <a name="anchor51"></a><br /><hr />
  827. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  828. <a name="rfc.section.5.3.4.2"></a><h3>5.3.4.2.&nbsp;
  829. Conditions for successful validation</h3>
  830. <p>
  831. If this keyword has boolean value false, the instance validates
  832. successfully. If it has boolean value true, the instance validates
  833. successfully if all of its elements are unique.
  834. </p>
  835. <a name="anchor52"></a><br /><hr />
  836. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  837. <a name="rfc.section.5.3.4.3"></a><h3>5.3.4.3.&nbsp;
  838. Default value</h3>
  839. <p>
  840. If not present, this keyword may be considered present with boolean
  841. value false.
  842. </p>
  843. <a name="anchor53"></a><br /><hr />
  844. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  845. <a name="rfc.section.5.4"></a><h3>5.4.&nbsp;
  846. Validation keywords for objects</h3>
  847. <a name="anchor54"></a><br /><hr />
  848. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  849. <a name="rfc.section.5.4.1"></a><h3>5.4.1.&nbsp;
  850. maxProperties</h3>
  851. <a name="anchor55"></a><br /><hr />
  852. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  853. <a name="rfc.section.5.4.1.1"></a><h3>5.4.1.1.&nbsp;
  854. Valid values</h3>
  855. <p>
  856. The value of this keyword MUST be an integer. This integer MUST be
  857. greater than, or equal to, 0.
  858. </p>
  859. <a name="anchor56"></a><br /><hr />
  860. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  861. <a name="rfc.section.5.4.1.2"></a><h3>5.4.1.2.&nbsp;
  862. Conditions for successful validation</h3>
  863. <p>
  864. An object instance is valid against "maxProperties" if its
  865. number of properties is less than, or equal to, the value of this
  866. keyword.
  867. </p>
  868. <a name="anchor57"></a><br /><hr />
  869. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  870. <a name="rfc.section.5.4.2"></a><h3>5.4.2.&nbsp;
  871. minProperties</h3>
  872. <a name="anchor58"></a><br /><hr />
  873. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  874. <a name="rfc.section.5.4.2.1"></a><h3>5.4.2.1.&nbsp;
  875. Valid values</h3>
  876. <p>
  877. The value of this keyword MUST be an integer. This integer MUST be
  878. greater than, or equal to, 0.
  879. </p>
  880. <a name="anchor59"></a><br /><hr />
  881. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  882. <a name="rfc.section.5.4.2.2"></a><h3>5.4.2.2.&nbsp;
  883. Conditions for successful validation</h3>
  884. <p>
  885. An object instance is valid against "minProperties" if its
  886. number of properties is greater than, or equal to, the value of this
  887. keyword.
  888. </p>
  889. <a name="anchor60"></a><br /><hr />
  890. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  891. <a name="rfc.section.5.4.2.3"></a><h3>5.4.2.3.&nbsp;
  892. Default value</h3>
  893. <p>
  894. If this keyword is not present, it may be considered present with a
  895. value of 0.
  896. </p>
  897. <a name="anchor61"></a><br /><hr />
  898. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  899. <a name="rfc.section.5.4.3"></a><h3>5.4.3.&nbsp;
  900. required</h3>
  901. <a name="anchor62"></a><br /><hr />
  902. <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc">&nbsp;TOC&nbsp;</a></td></tr></table>
  903. <a name="rfc.section.5.4.3.1"></a><h3>5.4.3.1.&nbsp;
  904. Valid values</h3>
  905. <p>
  906. The value of this keyword MUST be an array. This array MUST have at
  907. least one element. Elements