1 | {
|
2 | "title": "StringValidator",
|
3 | "@id": "stencila:StringValidator",
|
4 | "extends": "Entity",
|
5 | "role": "validation",
|
6 | "status": "unstable",
|
7 | "category": "data",
|
8 | "description": "A schema specifying constraints on a string node.",
|
9 | "$comment": "A node will be valid against the schema if it is a string that\nmeets the schemas `minLength`, `maxLength` and `pattern` properties.\nAnalogous to the JSON Schema `string` validation [type](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.1.1).\n",
|
10 | "properties": {
|
11 | "type": {
|
12 | "@id": "schema:type",
|
13 | "description": "The name of the type.",
|
14 | "type": "string",
|
15 | "enum": [
|
16 | "StringValidator"
|
17 | ],
|
18 | "default": "StringValidator",
|
19 | "from": "Entity"
|
20 | },
|
21 | "id": {
|
22 | "@id": "schema:id",
|
23 | "description": "The identifier for this item.",
|
24 | "type": "string",
|
25 | "from": "Entity"
|
26 | },
|
27 | "meta": {
|
28 | "@id": "stencila:meta",
|
29 | "description": "Metadata associated with this item.",
|
30 | "type": "object",
|
31 | "from": "Entity"
|
32 | },
|
33 | "minLength": {
|
34 | "@id": "stencila:minLength",
|
35 | "type": "number",
|
36 | "minimum": 0,
|
37 | "description": "The minimum length for a string node.",
|
38 | "$comment": "A string is valid if its length is greater than, or exactly equal to, `minLength`.\n",
|
39 | "from": "StringValidator"
|
40 | },
|
41 | "maxLength": {
|
42 | "@id": "stencila:maxLength",
|
43 | "type": "number",
|
44 | "minimum": 0,
|
45 | "description": "The maximum length for a string node.",
|
46 | "$comment": "A string is valid if its length is less than, or exactly equal to, `maxLength`.\n",
|
47 | "from": "StringValidator"
|
48 | },
|
49 | "pattern": {
|
50 | "@id": "stencila:pattern",
|
51 | "type": "string",
|
52 | "description": "A regular expression that a string node must match.",
|
53 | "$comment": "A string is valid if it is matched by the regular expression.\n",
|
54 | "from": "StringValidator"
|
55 | }
|
56 | },
|
57 | "file": "StringValidator.schema.yaml",
|
58 | "children": [],
|
59 | "descendants": [],
|
60 | "$schema": "http://json-schema.org/draft-07/schema#",
|
61 | "$id": "https://schema.stenci.la/v0/StringValidator.schema.json",
|
62 | "source": "https://github.com/stencila/schema/blob/master/StringValidator.schema.yaml",
|
63 | "type": "object",
|
64 | "additionalProperties": false,
|
65 | "required": [
|
66 | "type"
|
67 | ],
|
68 | "propertyAliases": {}
|
69 | }
|