summaryrefslogtreecommitdiff
path: root/icespider/compile/routes.ice
blob: 2c256641dabe2ee3a5bd276d09562b1af0c11fe8 (plain)
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
#ifndef ICESPIDER_ROUTES_ICE
#define ICESPIDER_ROUTES_ICE

#include "http.ice"

[["ice-prefix"]]
module IceSpider {
	local sequence<string> StringSeq;

	local class Parameter {
		ParameterSource source = URL;
		optional(0) string key;
		bool isOptional = false;
		["slicer:name:default"]
		optional(1) string defaultExpr;
		optional(2) string type;

		["slicer:ignore"]
		bool hasUserSource = true;
	};

	["slicer:json:object"]
	local dictionary<string, Parameter> Parameters;

	local class OutputSerializer {
		string serializer;
		StringSeq params;
	};

	["slicer:json:object"]
	local dictionary<string, OutputSerializer> OutputSerializers;

	local class Operation {
		string operation;
		StringMap paramOverrides;
	};

	["slicer:json:object"]
	local dictionary<string, Operation> Operations;

	local class Route {
		string path;
		HttpMethod method = GET;
		optional(0) string operation;
		Parameters params;
		Operations operations;
		string type;
		OutputSerializers outputSerializers;
		StringSeq bases;
		StringSeq mutators;
	};

	["slicer:json:object"]
	local dictionary<string, Route> Routes;

	local class RouteBase {
		StringSeq proxies;
		StringSeq functions;
	};

	["slicer:json:object"]
	local dictionary<string, RouteBase> RouteBases;

	local class RouteConfiguration {
		string name;
		Routes routes;
		RouteBases routeBases;
		StringSeq slices;
		StringSeq headers;
	};
};

#endif