-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_schema.json
57 lines (57 loc) · 1.87 KB
/
config_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
{
"id": "https://raw.githubusercontent.com/JSONScript/jsonscript-proxy/master/config_schema.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Configuration",
"description": "Schema for proxy server configuration file (and for config passed to proxy middleware)",
"type": "object",
"required": ["services"],
"properties": {
"services": {
"title": "proxied services",
"description": "each property name will be an executor exposed to JSONScript interpreter",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^[A-Za-z_$][A-Za-z_$0-9]+$": { "$ref": "#/definitions/service" }
}
},
"jsonscript": {
"description": "options passed to JSONScript interpreter",
"type": "object"
},
"processResponse": { "$ref": "#/definitions/processResponse" },
"Promise": {
"description": "Promise class to use, will be ignored if used from command line",
"typeof": "function"
}
},
"definitions": {
"service": {
"description": "proxied service definition",
"required": ["basePath"],
"properties": {
"basePath": {
"type": "string",
"format": "uri"
},
"processResponse": { "$ref": "#/definitions/processResponse" }
}
},
"processResponse": {
"description": "defines how response from service is processed",
"anyOf": [
{
"description": "return only response body if status code is < 300, throw an exception otherwise",
"type": "string",
"enum": ["body"]
},
{
"description": "uses custom keyword 'typeof', function should return result or throw exception",
"not": { "type": ["string", "number", "array", "object", "boolean", "null"] },
"typeof": "function"
}
]
}
}
}