forked from swisspost/gateleen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgateleen_delegate_schema_delegates
136 lines (136 loc) · 3.83 KB
/
gateleen_delegate_schema_delegates
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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Delegate definition",
"type": "object",
"properties": {
"methods": {
"description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.",
"type": "array",
"items": {
"type": "string"
}
},
"description": {
"description": "Documents this delegate",
"type": "string"
},
"doc": {
"description": "Link or reference to feature/specification documentation",
"type": "string"
},
"pattern": {
"description": "Pattern for grouping the incoming uri",
"type": "string"
},
"requests": {
"type": "array",
"items": {"$ref": "#/definitions/Request"}
}
},
"additionalProperties": false,
"definitions": {
"HeaderFunction": {
"properties": {
"header": {
"description": "the request-header name to manipulate (set, remove or conditional set)",
"type": "string",
"minLength": 1
},
"value": {
"description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly",
"type": [
"null",
"string"
]
},
"mode": {
"description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string",
"type": "string",
"enum": [
"complete",
"override"
]
}
},
"required": [
"header",
"value"
]
},
"Request": {
"oneOf": [
{ "required": ["payload"] },
{ "required": ["transform"] },
{ "required": ["transformWithMetadata"] }
],
"anyOf": [
{
"oneOf": [
{"required": ["dynamicHeaders"]},
{"required": ["headers"]}
]
},
{
"not": {
"required": ["dynamicHeaders", "headers"]
}
}
],
"properties": {
"uri": {
"description": "The target of the request",
"type": "string"
},
"method": {
"description": "The operation to perform",
"enum": [
"GET",
"PUT",
"POST",
"DELETE"
]
},
"payload": {
"description": "The payload to send in requests body",
"type": "object"
},
"transform": {
"description": "The jolt spec definition to transform the payload",
"type": "array"
},
"transformWithMetadata": {
"description": "The jolt spec definition to transform the payload and additional metadata",
"type": "array"
},
"dynamicHeaders": {
"description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales",
"type": "array",
"items": {
"$ref": "#/definitions/HeaderFunction"
}
},
"headers": {
"description": "Headers to send with the request",
"type": "array",
"items": {
"description": "Header value pairs",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"required": [
"uri",
"method"
],
"additionalProperties": false
}
},
"required": [
"methods",
"pattern",
"requests"
]
}