1 | {
|
2 | "title": "NumberValidator",
|
3 | "@id": "stencila:NumberValidator",
|
4 | "extends": "Entity",
|
5 | "role": "validation",
|
6 | "status": "unstable",
|
7 | "category": "data",
|
8 | "description": "A validator specifying the constraints on a numeric node.",
|
9 | "$comment": "A node will be valid if it is a number that meets the `maximum`, `multipleOf` etc properties.\nAnalogous to the JSON Schema `number` validation [type](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.1.1).\nNote that the `IntegerValidator` type extends this validator with the additional\nconstraint that the number have no fractional part.\n",
|
10 | "properties": {
|
11 | "type": {
|
12 | "@id": "schema:type",
|
13 | "description": "The name of the type.",
|
14 | "type": "string",
|
15 | "enum": [
|
16 | "NumberValidator",
|
17 | "IntegerValidator"
|
18 | ],
|
19 | "default": "NumberValidator",
|
20 | "from": "Entity"
|
21 | },
|
22 | "id": {
|
23 | "@id": "schema:id",
|
24 | "description": "The identifier for this item.",
|
25 | "type": "string",
|
26 | "from": "Entity"
|
27 | },
|
28 | "meta": {
|
29 | "@id": "stencila:meta",
|
30 | "description": "Metadata associated with this item.",
|
31 | "type": "object",
|
32 | "from": "Entity"
|
33 | },
|
34 | "minimum": {
|
35 | "@id": "stencila:minimum",
|
36 | "type": "number",
|
37 | "description": "The inclusive lower limit for a numeric node.",
|
38 | "$comment": "A number is valid if it is greater than, or exactly equal to, `minimum`.\n",
|
39 | "from": "NumberValidator"
|
40 | },
|
41 | "exclusiveMinimum": {
|
42 | "@id": "stencila:exclusiveMinimum",
|
43 | "type": "number",
|
44 | "description": "The exclusive lower limit for a numeric node.",
|
45 | "$comment": "A number is valid only if it has a value greater than (not equal to) `exclusiveMinimum`.\n",
|
46 | "from": "NumberValidator"
|
47 | },
|
48 | "maximum": {
|
49 | "@id": "stencila:maximum",
|
50 | "type": "number",
|
51 | "description": "The inclusive upper limit for a numeric node.",
|
52 | "$comment": "A number is valid if it is less than, or exactly equal to, `maximum`.\n",
|
53 | "from": "NumberValidator"
|
54 | },
|
55 | "exclusiveMaximum": {
|
56 | "@id": "stencila:exclusiveMaximum",
|
57 | "type": "number",
|
58 | "description": "The exclusive upper limit for a numeric node.",
|
59 | "$comment": "A number is valid only if it has a value less than (not equal to) `exclusiveMaximum`.\n",
|
60 | "from": "NumberValidator"
|
61 | },
|
62 | "multipleOf": {
|
63 | "@id": "stencila:multipleOf",
|
64 | "type": "number",
|
65 | "exclusiveMinimum": 0,
|
66 | "description": "A number that a numeric node must be a multiple of.",
|
67 | "$comment": "A number is valid only if division by this value results in an integer.\n",
|
68 | "from": "NumberValidator"
|
69 | }
|
70 | },
|
71 | "file": "NumberValidator.schema.yaml",
|
72 | "children": [
|
73 | "IntegerValidator"
|
74 | ],
|
75 | "descendants": [
|
76 | "IntegerValidator"
|
77 | ],
|
78 | "$schema": "http://json-schema.org/draft-07/schema#",
|
79 | "$id": "https://schema.stenci.la/v0/NumberValidator.schema.json",
|
80 | "source": "https://github.com/stencila/schema/blob/master/NumberValidator.schema.yaml",
|
81 | "type": "object",
|
82 | "additionalProperties": false,
|
83 | "required": [
|
84 | "type"
|
85 | ],
|
86 | "propertyAliases": {}
|
87 | }
|