-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp-request.schema.json
More file actions
240 lines (240 loc) · 6.65 KB
/
http-request.schema.json
File metadata and controls
240 lines (240 loc) · 6.65 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/studiowebux/restcli/main/http-request.schema.json",
"title": "HTTP Request File",
"description": "Schema for HTTP request files in YAML or JSON format",
"oneOf": [
{
"$ref": "#/definitions/SingleRequest"
},
{
"$ref": "#/definitions/MultipleRequests"
}
],
"definitions": {
"SingleRequest": {
"type": "object",
"required": ["method", "url"],
"properties": {
"name": {
"type": "string",
"description": "Optional name for the request"
},
"method": {
"type": "string",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"],
"description": "HTTP method"
},
"url": {
"type": "string",
"description": "Request URL (can include {{variables}})"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "HTTP headers"
},
"body": {
"type": "string",
"description": "Request body (for POST, PUT, PATCH)"
},
"filter": {
"type": "string",
"description": "Optional JMESPath filter expression to narrow response results"
},
"query": {
"type": "string",
"description": "Optional JMESPath query or $(bash command) to transform response"
},
"tls": {
"$ref": "#/definitions/TLSConfig",
"description": "Optional TLS/mTLS configuration for secure connections"
},
"documentation": {
"$ref": "#/definitions/Documentation",
"description": "Optional documentation for the request"
}
},
"additionalProperties": false
},
"TLSConfig": {
"type": "object",
"properties": {
"certFile": {
"type": "string",
"description": "Path to client certificate file (PEM format)"
},
"keyFile": {
"type": "string",
"description": "Path to client private key file (PEM format)"
},
"caFile": {
"type": "string",
"description": "Path to CA certificate file for server verification (PEM format)"
},
"insecureSkipVerify": {
"type": "boolean",
"description": "Skip server certificate verification (insecure, for testing only)",
"default": false
}
},
"additionalProperties": false
},
"Documentation": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Description of what the endpoint does"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Tags/categories for organizing endpoints"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/definitions/Parameter"
},
"description": "Request parameters"
},
"responses": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Response"
},
{
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Shorthand: {\"200\": \"Success\"}"
}
]
},
"description": "Expected responses"
}
},
"additionalProperties": false
},
"Parameter": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": {
"type": "string",
"description": "Parameter name"
},
"type": {
"type": "string",
"description": "Parameter type (string, number, boolean, object, array)"
},
"required": {
"type": "boolean",
"description": "Whether the parameter is required",
"default": false
},
"deprecated": {
"type": "boolean",
"description": "Whether the parameter is deprecated",
"default": false
},
"description": {
"type": "string",
"description": "Parameter description"
},
"example": {
"type": "string",
"description": "Example value for the parameter"
}
},
"additionalProperties": false
},
"ResponseField": {
"type": "object",
"required": ["name", "type"],
"properties": {
"name": {
"type": "string",
"description": "Field name"
},
"type": {
"type": "string",
"description": "Field type (string, number, boolean, object, array, etc.)"
},
"required": {
"type": "boolean",
"description": "Whether the field is required",
"default": false
},
"deprecated": {
"type": "boolean",
"description": "Whether the field is deprecated",
"default": false
},
"description": {
"type": "string",
"description": "Field description"
},
"example": {
"type": "string",
"description": "Example value for the field"
}
},
"additionalProperties": false
},
"Response": {
"type": "object",
"required": ["code", "description"],
"properties": {
"code": {
"type": "string",
"description": "HTTP status code",
"pattern": "^[1-5][0-9]{2}$"
},
"description": {
"type": "string",
"description": "Response description"
},
"contentType": {
"type": "string",
"description": "Response content type (e.g., application/json)"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/ResponseField"
},
"description": "Response body fields/schema"
},
"example": {
"type": "string",
"description": "Complete response example"
}
},
"additionalProperties": false
},
"MultipleRequests": {
"type": "object",
"required": ["requests"],
"properties": {
"requests": {
"type": "array",
"items": {
"$ref": "#/definitions/SingleRequest"
},
"minItems": 1,
"description": "Array of HTTP requests"
}
},
"additionalProperties": false
}
}
}