-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlitics.schema.json
103 lines (103 loc) · 2.94 KB
/
litics.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Litics",
"type": "object",
"additionalProperties": false,
"required": [
"events"
],
"properties": {
"components": {
"type": "object",
"description": "A container for various reusable definitions.",
"additionalProperties": false,
"properties": {
"parameters": {
"type": "object",
"description": "A container for reusable parameters. These can be referenced elsewhere in the file using anchors and aliases.",
"minProperties": 1,
"additionalProperties": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/parameters"
}
}
}
}
},
"events": {
"type": "object",
"description": "Tracking events to be generated.",
"additionalProperties": {
"type": "object",
"description": "A dictionary of events, with the key being the function name for the generated code.",
"additionalProperties": false,
"required": [
"name",
"supported_platforms"
],
"properties": {
"name": {
"type": "string",
"description": "Name of the event."
},
"description": {
"type": "string",
"description": "A description of the event. This will be the Kdoc of the generated function."
},
"supported_platforms": {
"type": "array",
"description": "The platforms that this event should be logged to.",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "string"
}
},
"parameters": {
"minProperties": 1,
"additionalProperties": {
"$ref": "#/$defs/parameters"
}
}
}
}
}
},
"$defs": {
"parameters": {
"type": "object",
"description": "A dictionary of parameters, with the key being the parameter name.",
"additionalProperties": false,
"required": [
"type",
"required"
],
"properties": {
"type": {
"enum": [
"string",
"number",
"boolean"
],
"description": "The data type of the parameter."
},
"description": {
"type": "string",
"description": "A description of the parameter. This will be the Kdoc of the generated function parameter."
},
"required": {
"type": "boolean",
"description": "`true` if the parameter is non-optional, otherwise `false`."
},
"default": {
"type": "string",
"description": "The default value of the parameter if the value isn't provided."
},
"example": {
"description": "An example value for this parameter."
}
}
}
}
}