api: YAML JSON TOON Database version: 1.0.0 format: json dataset: id: 1005 slug: json-schema-keywords title: JSON Schema 2020-12 Keyword Reference description: "Core validation and composition keywords in JSON Schema 2020-12, with compact examples and traps." summary: "Core validation and composition keywords in JSON Schema 2020-12, with compact examples and traps. Each row includes a practical application and a failure to check before using it." use_when[2]: Validate a dataset before sending it to an agent.,Design a small contract for API input or a downloaded table. caveats[2]: These examples target draft 2020-12.,Validation does not establish factual correctness. related[2]: date-time-interchange,http-response-headers category: Web Technologies category_slug: web-technologies tags: "web-technologies,json schema keywords,reference,engineering" view_count: 0 created_at: 1791798640 updated_at: 1791798640 reviewed_at: 2026-10-12 sources[2]{title,url}: JSON Schema validation specification,"https://json-schema.org/draft/2020-12/json-schema-validation" JSON Schema reference,"https://json-schema.org/understanding-json-schema/reference" reading[1]: validate-reference-data-with-json-schema provenance: "Original editorial reference notes by YJTOON, informed by the linked primary documentation. External specifications retain their own licenses." entry_count: 16 fields[4]{section,field,type,example}: data,keyword,string,type data,example,string,"{\"type\":\"string\"}" data,purpose,string,Constrain the JSON value type. data,pitfall,string,A numeric-looking string is still a string. data[16]{keyword,example,purpose,pitfall}: type,"{\"type\":\"string\"}",Constrain the JSON value type.,A numeric-looking string is still a string. properties,"{\"properties\":{\"name\":{\"type\":\"string\"}}}",Validate named object properties.,Listed properties are optional unless required says otherwise. required,"{\"required\":[\"name\"]}",Require object property presence.,Presence does not exclude an empty string or null by itself. additionalProperties,"{\"additionalProperties\":false}",Restrict properties not covered by properties or patternProperties.,Composition can require unevaluatedProperties instead. unevaluatedProperties,"{\"unevaluatedProperties\":false}",Restrict properties left unevaluated across applicable subschemas.,Use a validator with the correct draft support. items,"{\"items\":{\"type\":\"integer\"}}",Validate array items with one schema.,It does not require a nonempty array. prefixItems,"{\"prefixItems\":[{\"type\":\"string\"},{\"type\":\"integer\"}]}",Validate positional array elements.,Length constraints are separate. minItems,"{\"minItems\":1}",Require a minimum array length.,It does not constrain each item’s type. enum,"{\"enum\":[\"json\",\"yaml\",\"toon\"]}",Accept one of an explicit set of values.,Values are case sensitive. const,"{\"const\":\"ready\"}",Accept one exact JSON value.,It can constrain more than strings. minimum,"{\"minimum\":0}",Set an inclusive numeric lower bound.,Strings are not numeric values. pattern,"{\"pattern\":\"^[A-Z]{2}$\"}",Validate a string with a regular expression.,Patterns are not anchored automatically. allOf,"{\"allOf\":[{\"type\":\"integer\"},{\"minimum\":0}]}",Require every subschema to pass.,"It is logical intersection, not object inheritance." anyOf,"{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"number\"}]}",Require at least one passing subschema.,Multiple matches are allowed. oneOf,"{\"oneOf\":[{\"const\":\"a\"},{\"const\":\"b\"}]}",Require exactly one passing subschema.,Overlapping alternatives cause rejection. format,"{\"format\":\"date-time\"}",Annotate a string with a named semantic format.,Assertion behavior depends on the dialect and validator.