UNPKG

jschemer

Version:

A Node.js library to generate documentation for JSON Schemas

5,995 lines (1,322 loc) 56.4 kB
<!DOCTYPE html> <html lang=en dir=ltr> <head> <meta charset=utf-8> <title>Sample Schema</title> <meta name=viewport content='width=device-width, initial-scale=1, shrink-to-fit=no'> <link href=../schema-page.css rel=stylesheet> </head> <body> <nav id=jschemer-nav aria-labelledby=jschemer-schemas-list-heading role=navigation> <p><a href=../index.html>Home</a></p> <h2 id=jschemer-schemas-list-heading>Schemas</h1> <ul> <li> <p> <a href='schema.html'> Sample Schema </a> </p> </li> </ul> </nav> <main> <section id=https://raw.githubusercontent.com/dwhieb/jschemer/master/test/schemas/schema.json class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Sample Schema </h1> </summary> <p class='$schema keyword'> <b>Validate against:</b> <a href='http://json-schema.org/draft-07/schema#'>http://json-schema.org/draft-07/schema#</a> </p> <p class='$id keyword'> <b>Schema ID:</b> <code>https://raw.githubusercontent.com/dwhieb/jschemer/master/test/schemas/schema.json</code> </p> <p class='type keyword'> <b>Type:</b> <code>object</code> </p> <section class='description keyword'> <h2>Description</h2> <div><p>This is a description of this schema. It should support <i>basic</i> <sup>inline</sup> <em>HTML</em>, as well as <em>simple</em> <em>Markdown</em> <strong>styling</strong>. This schema shows how each JSON Schema keyword appears on its own.</p> </div> </section> <section class='$comment keyword'> <h2>Developer Notes</h2> <div><p>This is a test comment, aimed at readers or maintainers of the schema. This will be displayed as “Developer Notes”.</p> </div> </section> <section class='definitions keyword'> <h2>Schema Definitions</h2> <p>This schema defines the following subschemas for reuse:</p> <ul> <li id='/definitions/key'><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>key</code> </h1> </summary> <p class='pattern keyword'> <b>Regular expression to match:</b> <code>[A-Za-z]+</code> </p> </details> </section> </li> </ul> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Annotation Keywords: <code>annotations</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how annotation keywords are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> <code>title</code> Keyword: <code>title</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “title” keyword appears in jschemer documentation. Titles should also support basic Markdown syntax.</p> </div> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “default” Keyword: <code>default</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “default” keyword appears in jschemer documentation. The value of the “default” keyword should appear as an indented JSON string in a code block.</p> </div> </section> <section class='default keyword'> <h2>Default Value</h2> <p>The default value for this item is:</p> <pre><code>{ &quot;id&quot;: &quot;532708fd-b48e-48cb-9f3c-219f7aa53f80&quot;, &quot;key&quot;: &quot;LANG&quot;, &quot;name&quot;: &quot;language&quot; }</code></pre> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “description” Keyword: <code>description</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the <code>&quot;description&quot;</code> keyword appears in jschemer documentation. Descriptions should also support <em>Markdown</em> syntax.</p> </div> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “examples” Keyword: <code>examples</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “examples” keyword appears in jschemer documentation. Each example should be displayed as an indented JSON string in a code block.</p> </div> </section> <section class='examples keyword'> <h2>Examples</h2> <p>The following are example values for this schema:</p> <ul> <li> <pre><code>{ &quot;id&quot;: &quot;532708fd-b48e-48cb-9f3c-219f7aa53f80&quot;, &quot;key&quot;: &quot;LANG&quot;, &quot;name&quot;: &quot;language&quot; }</code></pre> </li> <li> <pre><code>{ &quot;id&quot;: &quot;1830a856-e826-418e-a6cb-782d207b1bae&quot;, &quot;key&quot;: &quot;MORPH&quot;, &quot;name&quot;: &quot;morpheme&quot; }</code></pre> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “readOnly” Keyword: <code>readOnly</code> </h1> </summary> <p class='readOnly keyword'> <b>Read-only:</b> <code>true</code> </p> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “readOnly” keyword appears in jschemer documentation.</p> </div> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “writeOnly” Keyword: <code>writeOnly</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “writeOnly” keyword appears in jschemer documentation.</p> </div> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Any Instance Type: <code>any</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply to any instance type are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “const” Keyword: <code>const</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “const” keyword appears in jschemer documentation.</p> </div> </section> <p>This item must have the following value:</p> <pre><code>&quot;This is a constant value.&quot;</code></pre> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “enum” Keyword: <code>enum</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “enum” keyword appears in jschemer documentation.</p> </div> </section> <section class='enum keyword'> <h2>Allowed Values</h2> <ul> <li><pre><code>1</code></pre></li> <li><pre><code>[]</code></pre></li> <li><pre><code>{}</code></pre></li> <li><pre><code>true</code></pre></li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “type” Keyword: <code>type</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “type” keyword appears in jschemer documentation.</p> </div> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Array Instance Types: <code>arrays</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply to array instance types are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “additionalItems” Keyword: <code>additionalItems</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “additionalItems” keyword appears in jschemer documentation. This keyword only applies when the “items” keyword is also present, and consists of an array of schemas. In this example, the first item in the array must be a string, and any additional items in the array must be numbers.</p> </div> </section> <section class='items keyword'> <h2>Items</h2> <p>The items in this array must adhere to the following schemas, in order:</p> <ul> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> <section class='additionalItems keyword'> <h2>Additional Items</h2> <p>If there are additional items in the array, they must adhere to the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>additionalItems</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>number</code> </p> </details> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “contains” Keyword: <code>contains</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “contains” keyword appears in jschemer documentation. In this example, at least one item in the array must be a string.</p> </div> </section> <section class='contains keyword'> <h2>Contains</h2> <p>The array must contain at least one element that adheres to the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>contains</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “items” Keyword as a Schema: <code>itemsSchema</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “items” keyword appears in jschemer documentation when the value of “items” is a single schema. In this example, each item must be a string with a minimum length of 1.</p> </div> </section> <section class='items keyword'> <h2>Items</h2> <p>Each item in this array must adhere to the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>itemsSchema</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> <p class='minLength keyword'> <b>Minimum length:</b> <code>1</code> </p> </details> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “items” Keyword as an Array: <code>itemsArray</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “items” keyword appears in jschemer documentation when the value of “items” is an array of schemas. In this example, the first item in the array must be <code>null</code>, and the second item in the array must be a string.</p> </div> </section> <section class='items keyword'> <h2>Items</h2> <p>The items in this array must adhere to the following schemas, in order:</p> <ul> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>null</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “maxItems” Keyword: <code>maxItems</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “maxItems” keyword appears in jschemer documentation.</p> </div> </section> <p class='maxItems keyword'> <b>Maximum number of items:</b> <code>10</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “minItems” Keyword: <code>minItems</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “minItems” keyword appears in jschemer documentation.</p> </div> </section> <p class='minItems keyword'> <b>Minimum number of items:</b> <code>1</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “uniqueItems” Keyword: <code>uniqueItems</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema show how the “uniqueItems” keyword appears in jschemer documentation.</p> </div> </section> <p class='uniqueItems keyword'> <b>Items must be unique:</b> <code>true</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Boolean Logic: <code>booleans</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply subschemas with boolean logic are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “allOf” Keyword: <code>allOf</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “allOf” keyword appears in jschemer documentation. In this example, the instance must validate against both subschemas — it must have an “id” property and it must be an object.</p> </div> </section> <section class='allOf keyword'> <p>This item must also validate against all of the following schemas:</p> <ul> <li><section class=jschemer-schema> <details open> <section class='required keyword'> <h2>Required Properties</h2> <ul> <li><code>id</code></li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>object</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “anyOf” Keyword: <code>anyOf</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “anyOf” keyword appears in jschemer documentation. In this example, the instance can validate against any of the subschemas — it may be either an object or an array.</p> </div> </section> <section class='anyOf keyword'> <p>This item must also validate against at least one of the following schemas:</p> <ul> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>object</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>array</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “not” Keyword: <code>not</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “not” keyword appears in jschemer documentation. In this example, the instance must not be null.</p> </div> </section> <p>This item must <strong>not</strong> validate against the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>not</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>null</code> </p> </details> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “oneOf” Keyword: <code>oneOf</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “oneOf” keyword appears in jschemer documentation. In this example, the instance may be either an object or a string.</p> </div> </section> <section class='oneOf'> <p>This item must also validate against exactly one of the following schemas:</p> <ul> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>object</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Conditional Validation: <code>conditionals</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply subschemas conditionally are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “if”, “then”, and “else” Keywords: <code>ifThen</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “if”, “then”, and “else” keywords are displayed in jschemer documentation. In this example, if the instance is a string, it must have a minimum length of 3 characters. If the instance is not a string, then it must be an object.</p> </div> </section> <section class='conditionals'> <h2>Conditional Valiation Rules</h2> <section class='if keyword'> <p>The following schema is used for conditional validation:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>ifThen</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </section> <section class='then keyword'> <p>If this item validates aginst the conditional schema shown above, it must also validate against the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>ifThen</code> </h1> </summary> <p class='minLength keyword'> <b>Minimum length:</b> <code>3</code> </p> </details> </section> </section> <section class='else keyword'> <p>If this item does not validate against the conditional schema shown aboe, it must validate against the following schema instead:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>ifThen</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>object</code> </p> </details> </section> </section> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Referenced Schemas: <code>references</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that are defined by reference to other schemas are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Schemas Defined in “definitions”: <code>definitions</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how schemas which reference definitions in the “definitions” property appear in jschemer documentation. In this example, the “key” property must validate against the “key” schema in the schema definitions.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>key</code> </h1> </summary> <section class='$ref keyword'> <h2>Referenced Schema</h2> <p>This item must validate against the following schema:</p> <p><a href='#/definitions/key'>#/definitions/key</a></p> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Schemas Referenced with “$ref”: <code>ref</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how schemas which reference external schemas using the “$ref” property appear in jschemer documentation. In this example, the “location” property references the GeoJSON schema. This schema also shows that properties on the referencing schema overwrite properties on the referenced schema, for the purpose of generating the jschemer documentation. For example, the referenced GeoJSON schema in this example has the title <code>GeoJSON</code>, but in the jschemer documentation this example will appear with the title <code>Schemas Referenced with &quot;$ref&quot;</code>.</p> </div> </section> <section class='$ref keyword'> <h2>Referenced Schema</h2> <p>This item must validate against the following schema:</p> <p><a href='http://geojson.org/schema/GeoJSON.json'>http://geojson.org/schema/GeoJSON.json</a></p> </section> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Non-JSON Data: <code>nonJSON</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply to non-JSON data encoded as a string are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “contentEncoding” Keyword: <code>contentEncoding</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “contentEncoding” keyword appears in jschemer documentation.</p> </div> </section> <p class='contentEncoding keyword'> <b>Content encoding:</b> <code>base64</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “contentMediaType” Keyword: <code>contentMediaType</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “contentMediaType” keyword appears in jschemer documentation.</p> </div> </section> <p class='contentMediaType keyword'> <b>Content media type:</b> <code>audio/wav</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Numeric Instance Types: <code>numeric</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply to numeric instance types are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “exclusiveMaximum” Keyword: <code>exclusiveMaximum</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “exclusiveMaximum” keyword appears in jschemer documentation.</p> </div> </section> <p class='exclusiveMaximum keyword'> <b>Exclusive maximum:</b> <code>10</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “exclusiveMinimum” Keyword: <code>exclusiveMinimum</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “exclusiveMinimum” keyword appears in jschemer documentation.</p> </div> </section> <p class='exclusiveMinimum keyword'> <b>Exclusive minimum:</b> <code>-10</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “maximum” Keyword: <code>maximum</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “maximum” keyword appears in jschemer documentation.</p> </div> </section> <p class='maximum keyword'> <b>Maximum:</b> <code>9.99</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “minimum” Keyword: <code>minimum</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “minimum” keyword appears in jschemer documentation.</p> </div> </section> <p class='minimum keyword'> <b>Minimum:</b> <code>-9.99</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “multipleOf” Keyword: <code>multipleOf</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “multipleOf” keyword appears in jschemer documentation.</p> </div> </section> <p class='multipleOf keyword'> <b>Multiple of:</b> <code>2</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> Keywords for Object Instances: <code>objects</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how keywords that apply to object instances are displayed in jschemer documentation.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “additionalProperties” Keyword Set to Boolean: <code>additionalPropertiesTrue</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “additionalProperties” keyword appears in jschemer documentation when it is set a boolean value. In this example, the object has one defined property, “id”, and no other properties are allowed.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>id</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> <section class='additionalProperties keyword'> <h2>Additional Properties</h2> <p>Any additional properties must adhere to the following schema:</p> <section class=jschemer-schema> <p>No values are valid for this schema.</p> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “additionalProperties” Keyword Set to a Schema: <code>additionalPropertiesSchema</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “additionalProperties” keyword appears in jschemer documentation when its value is another schema. In this example, the object has one defined property, “id”, but may have additional properties as long as those additional properties are strings.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>id</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> <section class='additionalProperties keyword'> <h2>Additional Properties</h2> <p>Any additional properties must adhere to the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>additionalPropertiesSchema</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “dependencies” Keyword: <code>dependencies</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “dependencies” keyword appears in jschemer documentation. In this example, the object has two dependencies: 1) if the object has an “id” property, it must also have a “key” property; 2) if the object has a “startTime” property, it must also have an “endTime” property.</p> </div> </section> <section class='dependencies keyword'> <h2>Dependencies</h2> <p>This object has the following dependencies between properties:</p> <ul> <li> <p>If the object has the <code>id</code> property, the object must also match the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>id</code> </h1> </summary> <section class='required keyword'> <h2>Required Properties</h2> <ul> <li><code>key</code></li> </ul> </section> </details> </section> </li> <li> <p>If this object has the <code>startTime</code> property, it must have the following properties as well:</p> <ul> <li>endTime</li> </ul> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “maxProperties” Keyword: <code>maxProperties</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “maxProperties” keyword appears in jschemer documentation.</p> </div> </section> <p class='maxProperties keyword'> <b>Maximum number of properties:</b> <code>5</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “minProperties” Keyword: <code>minProperties</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “minProperties” keyword appears in jschemer documentation.</p> </div> </section> <p class='minProperties keyword'> <b>Minimum number of properties:</b> <code>1</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “patternProperties” Keyword: <code>patternProperties</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “patternProperties” keyword appears in jschemer documentation. In this example, each property of the object must contain the string “-lang”, and the value of that property must be a string as well.</p> </div> </section> <section class='patternProperties keyword'> <h2>Regular Expression Properties</h2> <p>Property names which match one of the following regular expressions must validate against the associated schema.</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>-lang</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “properties” Keyword: <code>properties</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “properties” keyword appears in jschemer documentation. In this example, the schema specifies two properties for the object: “id” and “name”, both of which must be strings.</p> </div> </section> <section class='properties keyword'> <h2>Properties</h2> <p>The following properties are defined for this object:</p> <ul> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>id</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>name</code> </h1> </summary> <p class='type keyword'> <b>Type:</b> <code>string</code> </p> </details> </section> </li> </ul> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “propertyNames” Keyword: <code>propertyNames</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “propertyNames” keyword appears in jschemer documentation. In this example, each property name in the object must contain at least 3 characters.</p> </div> </section> <section class='propertyNames keyword'> <h2>Property Names</h2> <p>Each property name in this object must adhere to the following schema:</p> <section class=jschemer-schema> <details open> <summary> <h1 class='key keyword'> <code>propertyNames</code> </h1> </summary> <p class='minLength keyword'> <b>Minimum length:</b> <code>3</code> </p> </details> </section> </section> </details> </section> </li> <li><section class=jschemer-schema> <details open> <summary> <h1 class='title keyword'> “required” Keyword: <code>required</code> </h1> </summary> <section class='description keyword'> <h2>Description</h2> <div><p>This schema shows how the “required” keyword appears in jschemer documentation. In this example, the object must have an “id” property.</p> </div> </section> <section class='required keyword'> <h2>Required Properties</h2> <ul> <li><code>id</code></li>