Skip to content

Commit 3095309

Browse files
committed
Add missing hover descriptions
1 parent c6ae4a9 commit 3095309

File tree

11 files changed

+172
-83
lines changed

11 files changed

+172
-83
lines changed

draft-04/additionalItems.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
3939
return evaluatedIndexes;
4040
};
4141

42-
export default { id, compile, interpret, collectEvaluatedItems };
42+
const description = "If items is set to an array of schemas, validation succeeds if each element of the instance not covered by it validates against this schema.";
43+
44+
export default { id, compile, interpret, collectEvaluatedItems, description };

draft-04/dependencies.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ const interpret = (dependencies, instance, ast, dynamicAnchors, quiet) => {
3131
});
3232
};
3333

34-
export default { id, compile, interpret };
34+
const description = "If the object values are objects, this keyword specifies subschemas that are evaluated if the instance is an object and contains a certain property. If the object values are arrays, validation succeeds if, for each name that appears in both the instance and as a name within this keyword’s value, every item in the corresponding array is also the name of a property in the instance.";
35+
36+
export default { id, compile, interpret, description };

draft-04/exclusiveMaximum.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const id = "https://json-schema.org/keyword/draft-04/exclusiveMaximum";
22
const compile = (schema) => schema.value;
33
const interpret = () => true;
4+
const description = "Modifies the maximum keyword to succeed if the numberic instance is less than, but not equal to, the given number";
45

5-
export default { id, compile, interpret };
6+
export default { id, compile, interpret, description };

draft-04/exclusiveMinimum.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const id = "https://json-schema.org/keyword/draft-04/exclusiveMinimum";
22
const compile = (schema) => schema.value;
33
const interpret = () => true;
4+
const description = "Modifies the minimum keyword to succeed if the numberic instance is greater than, but not equal to, the given number";
45

5-
export default { id, compile, interpret };
6+
export default { id, compile, interpret, description };

draft-04/id.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export default { id: "https://json-schema.org/keyword/draft-04/id" };
1+
export default {
2+
id: "https://json-schema.org/keyword/draft-04/id",
3+
description: "This keyword declares an identifier for the schema resource."
4+
};

draft-04/items.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ const collectEvaluatedItems = (items, instance, ast, dynamicAnchors) => {
4040
: collectSet(range(0, items.length)));
4141
};
4242

43-
export default { id, compile, interpret, collectEvaluatedItems };
43+
const description = "If set to a schema, validation succeeds if each element of the instance validates against it, otherwise validation succeeds if each element of the instance validates against the schema at the same position, if any.";
44+
45+
export default { id, compile, interpret, collectEvaluatedItems, description };

draft-04/maximum.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ const interpret = ([maximum, isExclusive], instance) => {
2222
return isExclusive ? value < maximum : value <= maximum;
2323
};
2424

25-
export default { id, compile, interpret };
25+
const description = "Validation succeeds if the numeric instance is less than or equal to the given number. The behavior of this keyword is modified by the exclusiveMaximum keyword.";
26+
27+
export default { id, compile, interpret, description };

draft-04/minimum.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ const interpret = ([minimum, isExclusive], instance) => {
2222
return isExclusive ? value > minimum : value >= minimum;
2323
};
2424

25-
export default { id, compile, interpret };
25+
const description = "Validation succeeds if the numeric instance is greater than or equal to the given number. The behavior of this keyword is modified by the exclusiveMinimum keyword.";
26+
27+
export default { id, compile, interpret, description };

draft-04/ref.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export default { id: "https://json-schema.org/keyword/draft-04/ref" };
1+
export default {
2+
id: "https://json-schema.org/keyword/draft-04/ref",
3+
description: "This keyword is used to reference a statically identified schema."
4+
};

draft-04/schema.js

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
1-
import items from "../lib/keywords/items.js";
1+
import id from "../draft-04/id.js";
2+
import title from "../lib/keywords/title.js";
3+
import description from "../lib/keywords/description.js";
4+
import _default from "../lib/keywords/default.js";
5+
import multipleOf from "../lib/keywords/multipleOf.js";
6+
import maximum from "./maximum.js";
7+
import exclusiveMaximum from "./exclusiveMaximum.js";
8+
import minimum from "./minimum.js";
9+
import exclusiveMinimum from "./exclusiveMinimum.js";
10+
import maxLength from "../lib/keywords/maxLength.js";
11+
import minLength from "../lib/keywords/minLength.js";
12+
import pattern from "../lib/keywords/pattern.js";
13+
import additionalItems from "./additionalItems.js";
14+
import items from "./items.js";
15+
import maxItems from "../lib/keywords/maxItems.js";
16+
import minItems from "../lib/keywords/minItems.js";
17+
import uniqueItems from "../lib/keywords/uniqueItems.js";
18+
import maxProperties from "../lib/keywords/maxProperties.js";
19+
import minProperties from "../lib/keywords/minProperties.js";
20+
import required from "../lib/keywords/required.js";
221
import additionalProperties from "../lib/keywords/additionalProperties.js";
22+
import definitions from "../lib/keywords/definitions.js";
323
import properties from "../lib/keywords/properties.js";
424
import patternProperties from "../lib/keywords/patternProperties.js";
25+
import dependencies from "./dependencies.js";
26+
import _enum from "../lib/keywords/enum.js";
27+
import _type from "../lib/keywords/type.js";
28+
import format from "../lib/keywords/format.js";
529
import allOf from "../lib/keywords/allOf.js";
630
import anyOf from "../lib/keywords/anyOf.js";
731
import oneOf from "../lib/keywords/oneOf.js";
832
import not from "../lib/keywords/not.js";
9-
import typeKeyword from "../lib/keywords/type.js";
10-
import enumKeyword from "../lib/keywords/enum.js";
11-
import pattern from "../lib/keywords/pattern.js";
12-
import minLength from "../lib/keywords/minLength.js";
13-
import maxLength from "../lib/keywords/maxLength.js";
14-
import exclusiveMaximum from "../lib/keywords/exclusiveMaximum.js";
15-
import multipleOf from "../lib/keywords/multipleOf.js";
16-
import exclusiveMinimum from "../lib/keywords/exclusiveMinimum.js";
17-
import maximum from "../lib/keywords/maximum.js";
18-
import minimum from "../lib/keywords/minimum.js";
19-
import maxProperties from "../lib/keywords/maxProperties.js";
20-
import minProperties from "../lib/keywords/minProperties.js";
21-
import required from "../lib/keywords/required.js";
22-
import maxItems from "../lib/keywords/maxItems.js";
23-
import minItems from "../lib/keywords/minItems.js";
24-
import uniqueItems from "../lib/keywords/uniqueItems.js";
25-
import title from "../lib/keywords/title.js";
26-
import description from "../lib/keywords/description.js";
27-
import format from "../lib/keywords/format.js";
2833

2934

3035
export default {
@@ -57,10 +62,14 @@ export default {
5762
"type": "object",
5863
"properties": {
5964
"id": {
60-
"type": "string"
65+
"type": "string",
66+
"description": id.description
6167
},
6268
"$schema": {
63-
"type": "string"
69+
"type": "string",
70+
"description": `This keyword is both used as a JSON Schema dialect \
71+
identifier and as a reference to a JSON Schema which describes the set \
72+
of valid schemas written for this particular dialect.`
6473
},
6574
"title": {
6675
"type": "string",
@@ -70,7 +79,9 @@ export default {
7079
"type": "string",
7180
"description": description.description
7281
},
73-
"default": {},
82+
"default": {
83+
"description": _default.description
84+
},
7485
"multipleOf": {
7586
"type": "number",
7687
"minimum": 0,
@@ -113,7 +124,8 @@ export default {
113124
{ "type": "boolean" },
114125
{ "$ref": "#" }
115126
],
116-
"default": {}
127+
"default": {},
128+
"description": additionalItems.description
117129
},
118130
"items": {
119131
"anyOf": [
@@ -137,8 +149,10 @@ export default {
137149
"description": uniqueItems.description
138150
},
139151
"maxProperties": {
140-
"allOf": [{ "$ref": "#/definitions/positiveIntegerDefault0" }],
141-
"$ref": "#/definitions/positiveInteger",
152+
"allOf": [
153+
{ "$ref": "#/definitions/positiveIntegerDefault0" },
154+
{ "$ref": "#/definitions/positiveInteger" }
155+
],
142156
"description": maxProperties.description
143157
},
144158
"minProperties": {
@@ -160,7 +174,8 @@ export default {
160174
"definitions": {
161175
"type": "object",
162176
"additionalProperties": { "$ref": "#" },
163-
"default": {}
177+
"default": {},
178+
"description": definitions.description
164179
},
165180
"properties": {
166181
"type": "object",
@@ -181,13 +196,14 @@ export default {
181196
{ "$ref": "#" },
182197
{ "$ref": "#/definitions/stringArray" }
183198
]
184-
}
199+
},
200+
"description": dependencies.description
185201
},
186202
"enum": {
187203
"type": "array",
188204
"minItems": 1,
189205
"uniqueItems": true,
190-
"description": enumKeyword.description
206+
"description": _enum.description
191207
},
192208
"type": {
193209
"anyOf": [
@@ -199,19 +215,19 @@ export default {
199215
"uniqueItems": true
200216
}
201217
],
202-
"description": typeKeyword.description
218+
"description": _type.description
203219
},
204220
"format": { "type": "string", "description": format.description },
205221
"allOf": {
206222
"allOf": [{ "$ref": "#/definitions/schemaArray" }],
207223
"description": allOf.description
208224
},
209225
"anyOf": {
210-
"anyOf": [{ "$ref": "#/definitions/schemaArray" }],
226+
"allOf": [{ "$ref": "#/definitions/schemaArray" }],
211227
"description": anyOf.description
212228
},
213229
"oneOf": {
214-
"oneOf": [{ "$ref": "#/definitions/schemaArray" }],
230+
"allOf": [{ "$ref": "#/definitions/schemaArray" }],
215231
"description": oneOf.description
216232
},
217233
"not": {

0 commit comments

Comments
 (0)