1
1
const queryStringJsonSchemaGeneral = {
2
2
type : 'object' ,
3
3
properties : {
4
- bearings : {
5
- type : 'string' ,
6
- // TODO: pattern
7
- } ,
8
- radiuses : {
9
- type : 'string' ,
10
- // TODO: pattern
11
- } ,
12
- generate_hints : { type : 'boolean' , default : true } ,
13
- hints : {
14
- type : 'string' ,
15
- // TODO: pattern
16
- } ,
17
- approaches : {
18
- type : 'string' ,
19
- // TODO: pattern
20
- } ,
21
- exclude : {
22
- type : 'string' ,
23
- // TODO: pattern
24
- } ,
25
- snapping : {
26
- enum : [ 'any' , 'default' ] ,
27
- default : 'default'
28
- } ,
29
- skip_waypoints : { type : 'boolean' , default : false } ,
4
+ bearings : {
5
+ type : 'string' ,
6
+ // TODO: pattern
7
+ } ,
8
+ radiuses : {
9
+ type : 'string' ,
10
+ // TODO: pattern
11
+ } ,
12
+ generate_hints : { type : 'boolean' , default : true } ,
13
+ hints : {
14
+ type : 'string' ,
15
+ // TODO: pattern
16
+ } ,
17
+ approaches : {
18
+ type : 'string' ,
19
+ // TODO: pattern
20
+ } ,
21
+ exclude : {
22
+ type : 'string' ,
23
+ // TODO: pattern
24
+ } ,
25
+ snapping : {
26
+ enum : [ 'any' , 'default' ] ,
27
+ default : 'default'
28
+ } ,
29
+ skip_waypoints : { type : 'boolean' , default : false } ,
30
30
}
31
- } ;
31
+ } ;
32
32
33
- const queryStringJsonSchemaRoute = {
33
+ const queryStringJsonSchemaRoute = {
34
34
type : 'object' ,
35
35
properties : {
36
- ...queryStringJsonSchemaGeneral . properties ,
37
- alternatives : { type : [ 'boolean' , 'integer' ] , default : false } ,
38
- steps : { type : 'boolean' , default : false } ,
39
- annotations : {
40
- type : 'string' ,
41
- // TODO: pattern
42
- } ,
43
- geometries : {
44
- enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
45
- default : 'polyline'
46
- } ,
47
- overview : {
48
- enum : [ 'simplified' , 'full' , 'false' ] ,
49
- default : 'simplified'
50
- } ,
51
- continue_straight : {
52
- type : 'string' ,
53
- // TODO:
54
- } ,
55
- waypoints : {
56
- type : 'string' ,
57
- // list of numbers separated by semicolon
58
- pattern : '^(\\d+(;\\d+)*)?$'
59
- }
36
+ ...queryStringJsonSchemaGeneral . properties ,
37
+ alternatives : { type : [ 'boolean' , 'integer' ] , default : false } ,
38
+ steps : { type : 'boolean' , default : false } ,
39
+ annotations : {
40
+ type : 'string' ,
41
+ // TODO: pattern
42
+ } ,
43
+ geometries : {
44
+ enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
45
+ default : 'polyline'
46
+ } ,
47
+ overview : {
48
+ enum : [ 'simplified' , 'full' , 'false' ] ,
49
+ default : 'simplified'
50
+ } ,
51
+ continue_straight : {
52
+ type : 'string' ,
53
+ // TODO:
54
+ } ,
55
+ waypoints : {
56
+ type : 'string' ,
57
+ // list of numbers separated by semicolon
58
+ pattern : '^(\\d+(;\\d+)*)?$'
59
+ }
60
60
}
61
- }
61
+ }
62
62
63
- const queryStringJsonSchemaNearest = {
63
+ const queryStringJsonSchemaNearest = {
64
64
type : 'object' ,
65
65
properties : {
66
- ...queryStringJsonSchemaGeneral . properties ,
67
- alternatives : { type : [ 'integer' ] , default : 1 }
66
+ ...queryStringJsonSchemaGeneral . properties ,
67
+ alternatives : { type : [ 'integer' ] , default : 1 }
68
68
}
69
- }
69
+ }
70
70
71
- const queryStringJsonSchemaTable = {
71
+ const queryStringJsonSchemaTable = {
72
72
type : 'object' ,
73
73
properties : {
74
- ...queryStringJsonSchemaGeneral . properties ,
75
- // TODO: all
76
- sources : {
77
- type : 'string' ,
78
- // list of numbers separated by semicolon
79
- pattern : '^(\\d+(;\\d+)*)?$'
80
- } ,
81
- // TODO: all
82
- destinations : {
83
- type : 'string' ,
84
- // list of numbers separated by semicolon
85
- pattern : '^(\\d+(;\\d+)*)?$'
86
- } ,
87
- annotations : {
88
- type : 'string' ,
89
- // TODO: pattern
90
- } ,
91
- fallback_speed : {
92
- type : 'number' ,
93
- exclusiveMinimum : 0
94
- } ,
95
- fallback_coordinate : {
96
- enum : [ 'input' , 'snapped' ] ,
97
- default : 'input'
98
- } ,
99
- scale_factor : {
100
- type : 'number' ,
101
- exclusiveMinimum : 0
102
- }
74
+ ...queryStringJsonSchemaGeneral . properties ,
75
+ // TODO: all
76
+ sources : {
77
+ type : 'string' ,
78
+ // list of numbers separated by semicolon
79
+ pattern : '^(\\d+(;\\d+)*)?$'
80
+ } ,
81
+ // TODO: all
82
+ destinations : {
83
+ type : 'string' ,
84
+ // list of numbers separated by semicolon
85
+ pattern : '^(\\d+(;\\d+)*)?$'
86
+ } ,
87
+ annotations : {
88
+ type : 'string' ,
89
+ // TODO: pattern
90
+ } ,
91
+ fallback_speed : {
92
+ type : 'number' ,
93
+ exclusiveMinimum : 0
94
+ } ,
95
+ fallback_coordinate : {
96
+ enum : [ 'input' , 'snapped' ] ,
97
+ default : 'input'
98
+ } ,
99
+ scale_factor : {
100
+ type : 'number' ,
101
+ exclusiveMinimum : 0
102
+ }
103
103
}
104
- }
104
+ }
105
105
106
106
107
- const queryStringJsonSchemaMatch = {
107
+ const queryStringJsonSchemaMatch = {
108
108
type : 'object' ,
109
109
properties : {
110
- ...queryStringJsonSchemaGeneral . properties ,
111
-
112
- steps : { type : 'boolean' , default : false } ,
113
-
114
- geometries : {
115
- enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
116
- default : 'polyline'
117
- } ,
118
- timestamps : {
119
- type : 'string' ,
120
- // list of numbers separated by semicolon
121
- pattern : '^(\\d+(;\\d+)*)?$'
122
- } ,
123
- overview : {
124
- enum : [ 'simplified' , 'full' , 'false' ] ,
125
- default : 'simplified'
126
- } ,
127
- gaps : {
128
- enum : [ 'split' , 'ignore' ] ,
129
- default : 'split'
130
- } ,
131
- tidy : { type : 'boolean' , default : false } ,
132
- waypoints : {
133
- type : 'string' ,
134
- // list of numbers separated by semicolon
135
- pattern : '^(\\d+(;\\d+)*)?$'
136
- } ,
110
+ ...queryStringJsonSchemaGeneral . properties ,
111
+
112
+ steps : { type : 'boolean' , default : false } ,
113
+
114
+ geometries : {
115
+ enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
116
+ default : 'polyline'
117
+ } ,
118
+ timestamps : {
119
+ type : 'string' ,
120
+ // list of numbers separated by semicolon
121
+ pattern : '^(\\d+(;\\d+)*)?$'
122
+ } ,
123
+ overview : {
124
+ enum : [ 'simplified' , 'full' , 'false' ] ,
125
+ default : 'simplified'
126
+ } ,
127
+ gaps : {
128
+ enum : [ 'split' , 'ignore' ] ,
129
+ default : 'split'
130
+ } ,
131
+ tidy : { type : 'boolean' , default : false } ,
132
+ waypoints : {
133
+ type : 'string' ,
134
+ // list of numbers separated by semicolon
135
+ pattern : '^(\\d+(;\\d+)*)?$'
136
+ } ,
137
137
}
138
- }
138
+ }
139
139
140
- const queryStringJsonSchemaTrip = {
140
+ const queryStringJsonSchemaTrip = {
141
141
type : 'object' ,
142
142
properties : {
143
- ...queryStringJsonSchemaGeneral . properties ,
144
-
145
- roundtrip : { type : 'boolean' , default : true } ,
146
- source : {
147
- enum : [ 'any' , 'first' ] ,
148
- default : 'any'
149
- } ,
150
- destination : {
151
- enum : [ 'any' , 'last' ] ,
152
- default : 'any'
153
- } ,
154
- annotations : {
155
- type : 'string' ,
156
- // TODO: pattern
157
- } ,
158
- geometries : {
159
- enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
160
- default : 'polyline'
161
- } ,
162
- overview : {
163
- enum : [ 'simplified' , 'full' , 'false' ] ,
164
- default : 'simplified'
165
- }
143
+ ...queryStringJsonSchemaGeneral . properties ,
144
+
145
+ roundtrip : { type : 'boolean' , default : true } ,
146
+ source : {
147
+ enum : [ 'any' , 'first' ] ,
148
+ default : 'any'
149
+ } ,
150
+ destination : {
151
+ enum : [ 'any' , 'last' ] ,
152
+ default : 'any'
153
+ } ,
154
+ annotations : {
155
+ type : 'string' ,
156
+ // TODO: pattern
157
+ } ,
158
+ geometries : {
159
+ enum : [ 'polyline' , 'polyline6' , 'geojson' ] ,
160
+ default : 'polyline'
161
+ } ,
162
+ overview : {
163
+ enum : [ 'simplified' , 'full' , 'false' ] ,
164
+ default : 'simplified'
165
+ }
166
166
}
167
- }
167
+ }
168
168
169
- export const routeSchema = {
169
+ export const routeSchema = {
170
170
querystring : queryStringJsonSchemaRoute ,
171
- }
171
+ }
172
172
173
173
174
- export const nearestSchema = {
174
+ export const nearestSchema = {
175
175
querystring : queryStringJsonSchemaNearest ,
176
- }
176
+ }
177
177
178
- export const tableSchema = {
178
+ export const tableSchema = {
179
179
querystring : queryStringJsonSchemaTable ,
180
- }
180
+ }
181
181
182
- export const matchSchema = {
182
+ export const matchSchema = {
183
183
querystring : queryStringJsonSchemaMatch ,
184
- }
185
- export const tripSchema = {
184
+ }
185
+ export const tripSchema = {
186
186
querystring : queryStringJsonSchemaTrip ,
187
- }
187
+ }
188
+
189
+ const paramsJsonSchemaTile = {
190
+ type : 'object' ,
191
+ properties : {
192
+ z : { type : 'integer' , minimum : 12 , maximum : 22 } ,
193
+ x : { type : 'integer' , minimum : 0 } ,
194
+ y : { type : 'integer' , minimum : 0 } ,
195
+ } ,
196
+ } ;
197
+
198
+ export const tileSchema = {
199
+ params : paramsJsonSchemaTile ,
200
+ } ;
0 commit comments