-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjrgen-spec.schema.json
148 lines (148 loc) · 4.42 KB
/
jrgen-spec.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"jrgen": {
"description": "Version of the jrgen spec.",
"type": "string",
"enum": ["1.0", "1.1", "1.2"]
},
"jsonrpc": {
"description": "Version of the json-rpc protocol.",
"type": "string",
"enum": ["2.0"]
},
"info": {
"description": "Meta information about the api.",
"type": "object",
"properties": {
"title": {
"description": "Name of the api.",
"type": "string",
"minLength": 1
},
"description": {
"description": "Description or usage information about the api.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"version": {
"description": "Current version of the api.",
"type": "string",
"minLength": 3
},
"servers": {
"description": "Server endpoints that implement this api.",
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"description": "URL to a server endpoint.",
"type": "string",
"format": "uri"
},
"description": {
"description": "Description about the server.",
"type": "string"
}
},
"required": ["url"]
}
}
},
"required": ["title", "version"]
},
"definitions": {
"description": "Global definitions for use in the api.",
"type": "object"
},
"methods": {
"description": "Definitions of the available procedures in the api. A key equals to the name of a procedure.",
"type": "object",
"patternProperties": {
"^.*$": {
"description": "Definition of an api procedure.",
"type": "object",
"properties": {
"summary": {
"description": "Short summary of what the procedure does.",
"type": "string"
},
"description": {
"description": "Longer description of what the procedure does.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"tags": {
"description": "Tags for grouping similar procedures.",
"type": "array",
"items": {
"description": "Tag for the procedure.",
"type": "string"
}
},
"params": {
"description": "JSON-Schema of the procedure params.",
"type": "object",
"$ref": "http://json-schema.org/schema#"
},
"result": {
"description": "JSON-Schema of the procedure result.",
"type": "object",
"$ref": "http://json-schema.org/schema#"
},
"errors": {
"description": "Definition of possible error responses.",
"type": "array",
"items": {
"description": "Definition of an error response.",
"type": "object",
"properties": {
"description": {
"description": "Description of what went wrong.",
"type": "string"
},
"code": {
"description": "Unique error code.",
"type": "number"
},
"message": {
"description": "Unique error message,",
"type": "string"
},
"data": {
"description": "JSON-Schema of the additonal error data.",
"type": "object",
"$ref": "http://json-schema.org/schema#"
}
},
"required": ["code", "message"]
}
}
},
"required": ["summary"]
}
}
}
},
"required": ["jrgen", "jsonrpc", "info", "methods"]
}