-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathuniversal-proxy-config.schema.json
More file actions
146 lines (146 loc) · 5.71 KB
/
universal-proxy-config.schema.json
File metadata and controls
146 lines (146 loc) · 5.71 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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Universal Proxy Configuration",
"description": "Configuration schema for universal proxy service with multiple platform integrations",
"type": "object",
"properties": {
"platforms": {
"type": "object",
"description": "Configuration for different platform integrations",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"description": "Platform configuration",
"properties": {
"base_url": {
"type": "string",
"format": "uri",
"description": "Base URL for the platform API"
},
"api_key": {
"type": "object",
"description": "API key configuration",
"properties": {
"location": {
"type": "string",
"enum": ["header", "query", "body", "path"],
"description": "Where to place the API key"
},
"param_name": {
"type": "string",
"description": "Name of the parameter/header for the API key"
},
"prefix": {
"type": "string",
"description": "Optional prefix for the API key (e.g., 'Bearer')"
}
},
"required": ["location", "param_name"],
"additionalProperties": false
},
"endpoints": {
"type": "object",
"description": "Available endpoints for this platform",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"description": "Endpoint configuration",
"properties": {
"path": {
"type": "string",
"description": "URL path for the endpoint, may contain placeholders like :address"
},
"method": {
"type": "string",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
"description": "HTTP method for the endpoint"
},
"params": {
"type": "array",
"description": "Parameters required for this endpoint",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": ["path", "query", "header", "body"],
"description": "Where the parameter should be placed"
},
"type": {
"type": "string",
"enum": ["address", "chain_id", "chain_id_dependent", "string", "number", "boolean"],
"description": "Type of the parameter"
},
"name": {
"type": "string",
"description": "Name of the parameter (required for query/header/body parameters)"
},
"mapping": {
"type": "object",
"description": "Mapping for chain_id_dependent parameters",
"patternProperties": {
"^[0-9]+$": {
"type": "string"
}
},
"additionalProperties": false
},
"required": {
"type": "boolean",
"description": "Whether this parameter is required",
"default": true
},
"default": {
"description": "Default value for the parameter"
}
},
"required": ["location", "type"],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"location": {
"enum": ["query", "header", "body"]
}
}
},
"then": {
"required": ["name"]
}
},
{
"if": {
"properties": {
"type": {
"const": "chain_id_dependent"
}
}
},
"then": {
"required": ["mapping"]
}
}
]
}
}
},
"required": ["path"],
"additionalProperties": false
}
},
"additionalProperties": false,
"minProperties": 1
}
},
"required": ["base_url", "endpoints"],
"additionalProperties": false
}
},
"additionalProperties": false,
"minProperties": 1
}
},
"required": ["platforms"],
"additionalProperties": false
}