-
Notifications
You must be signed in to change notification settings - Fork 6
/
schema.json
35 lines (33 loc) · 1.4 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
"$schema": "http://json-schema.org/schema#",
"id": "https://github.com/txgruppi/json2react/blob/v0.0.0/schema.json",
"title": "JSON React Element",
"definitions": {
"json_react_element": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The `nodeName` of the element you want to create. e.g.: div; span; strong. Can be any value accepted as first argument of `React.createElement`."
},
"props": {
"type": "object",
"additionalProperties": true,
"description": "The properties of the element you want to create. e.g.: { 'className': 'col-xs-12' }. Can be any value accepted as second argument of `React.createElement`"
},
"children": {
"oneOf": [
{ "type": "string" },
{ "$ref": "#/definitions/json_react_element" },
{ "type": "array", "items": { "$ref": "#/definitions/json_react_element" } }
],
"description": "The children of the element you want to create. If it is a string it will be used as `textContent`; if it is an array it will be mapped using the `json2react` function; if it is an object it will be used as an object described by this schema."
}
},
"required": [ "type" ],
"additionalProperties": false
}
},
"type": "object",
"$ref": "#/definitions/json_react_element"
}