generated from MapColonies/ts-server-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi3.yaml
More file actions
1109 lines (1106 loc) · 32.8 KB
/
openapi3.yaml
File metadata and controls
1109 lines (1106 loc) · 32.8 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.1
info:
version: 2.2.1
title: Geocoding
description: >-
MapColonies Vector Geocoding api provides custom geodata search engine
uniting multiple sources of data, query tiles, routes, items; Convertion
functions - tile to/from WGS84 lat lng, WGS84 to/from US Army MGRS, WGS84
to/from UTM.
license:
name: MIT
url: https://opensource.org/licenses/MIT
tags:
- name: Location Name Based Search
- name: Control
- name: Convertions
paths:
/search/query:
get:
operationId: GetSmartQuery
summary: Search anything
description: >-
This is for general queries. the services will make a sophisticated
guess.
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: query
in: query
required: true
schema:
type: string
minLength: 3
maxLength: 100
title: Query
description: Text to search
allowReserved: true
- $ref: '#/components/parameters/geo_context'
- $ref: '#/components/parameters/geo_context_mode'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/disable_fuzziness'
responses:
'200':
description: OK </br> Will return valid GeoJSON FeatureCollection
headers:
x-request-id:
schema:
type: string
minLength: 1
maxLength: 36
content:
application/json:
schema:
$ref: '#/components/schemas/genericGeocodingResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/search/location/query:
get:
operationId: locationGetQuery
summary: Search engine
description: >-
Search for geo-data. It serves data from multiple diverse mapcolonies
vector sources and partners.
tags:
- Location Name Based Search
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: query
in: query
required: true
schema:
type: string
minLength: 3
maxLength: 100
title: Query
description: Text to search
allowReserved: true
- name: source
in: query
required: false
schema:
type: array
items:
$ref: '#/components/schemas/Source'
title: Source
description: |
Sources to include (if not specified, all sources will be queried)
- name: region
in: query
required: false
schema:
type: array
items:
$ref: '#/components/schemas/Region'
description: Regions to include (if not specified, all Regions will be queried)
title: Region
description: Regions to include (if not specified, all Regions will be queried)
- $ref: '#/components/parameters/geo_context'
- $ref: '#/components/parameters/geo_context_mode'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/disable_fuzziness'
responses:
'200':
description: OK
x-request-id:
schema:
type: string
minLength: 1
maxLength: 36
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/genericGeocodingResponse'
- type: object
required:
- type
- features
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
type: object
properties:
geometry:
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/Polygon'
properties:
type: object
properties:
placetype:
type: string
sub_placetype:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/location/regions:
get:
operationId: locationGetRegions
tags:
- Location Name Based Search
summary: Get all available regions to filter on using location query
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
responses:
'200':
description: All regions
content:
application/json:
schema:
type: array
items:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/location/sources:
get:
operationId: locationGetSources
tags:
- Location Name Based Search
summary: Get all available sources to filter on using location query
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
responses:
'200':
description: All sources
content:
application/json:
schema:
type: array
items:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/control/tiles:
get:
operationId: controlGetTilesByQueryParams
tags:
- Control
summary: Search tiles and sub tiles
description: >-
Tiles are consisted of 3 characters.</br>
You can query and get results from 2 characters. </br></br> If you
define a tile (full name of it) you can query the sub tile associated
with it. </br>
You may also search tile based on 1 meter precision MGRS tile.
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: tile
in: query
description: Tile name
schema:
type: string
minLength: 2
maxLength: 3
- name: sub_tile
in: query
description: Sub tile number
schema:
type: string
pattern: ^[0-9][0-9]*$
- name: mgrs
description: 1 meters MGRS Tile
example: 18SUJ2338907395
in: query
schema:
type: string
- $ref: '#/components/parameters/geo_context'
- $ref: '#/components/parameters/geo_context_mode'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/disable_fuzziness'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/tilesSchema'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/control/items:
get:
operationId: controlGetItemsByQueryParams
tags:
- Control
summary: Search control items
description: ''
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: command_name
in: query
description: Object command name of the item
schema:
type: string
required: true
- name: tile
in: query
description: The tile the item in it (full name of it)
schema:
type: string
minLength: 3
maxLength: 3
required: false
- name: sub_tile
in: query
description: The sub tile the item in it (required if tile is defined)
schema:
type: string
pattern: ^[0-9][0-9]*$
example: '66'
- $ref: '#/components/parameters/geo_context'
- $ref: '#/components/parameters/geo_context_mode'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/disable_fuzziness'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/itemsSchema'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/control/routes:
get:
operationId: controlGetRoutesByQueryParams
tags:
- Control
summary: Search routes and report control points
description: >-
You can query and get control routes. <br><br> If you define a route
(full name of it) you can query the control points associated with it.
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: command_name
in: query
description: Object command name of the item
schema:
type: string
required: true
- name: control_point
in: query
description: The associated report control point of the route
schema:
type: string
pattern: ^[1-9][0-9]*$
- $ref: '#/components/parameters/geo_context'
- $ref: '#/components/parameters/geo_context_mode'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/disable_fuzziness'
responses:
'200':
description: OK (can be routesSchema or itemsSchema)
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/routesSchema'
- $ref: '#/components/schemas/itemsSchema'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/search/MGRS/tiles:
get:
operationId: getMGRSToGeom
tags:
- MGRS
summary: Convert a MGRS string to Geometry in GeoJSON
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: tile
in: query
description: MGRS tile string
schema:
type: string
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/mgrsTileSchema'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
/lookup/coordinates:
get:
operationId: convertionGetLatLonToMgrs
tags:
- Convertions
summary: Convert a WGS84 coordinate to US Army MGRS / Control Grid
parameters:
- $ref: '#/components/parameters/token'
- $ref: '#/components/parameters/xApiKey'
- name: lat
in: query
description: Latitude of the coordinate
schema:
type: number
minimum: -90
maximum: 90
required: true
- name: lon
in: query
description: Longitude of the coordinate
schema:
type: number
minimum: -180
maximum: 180
required: true
- name: target_grid
in: query
description: Choose target grid
schema:
type: string
enum:
- control
- MGRS
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
type:
type: string
enum:
- Feature
geocoding:
type: object
properties:
version:
type: string
example: 1.5.3
query:
type: object
properties:
lat:
type: number
lon:
type: number
target_grid:
type: string
example: control
response:
type: object
properties:
max_score:
type: number
example: 1
results_count:
type: number
example: 1
match_latency_ms:
type: number
bbox:
$ref: '#/components/schemas/BoundingBox'
geometry:
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/Polygon'
properties:
type: object
properties:
score:
type: number
example: 1
matches:
type: array
items:
type: object
required:
- source
- layer
- source_id
properties:
layer:
type: string
example: MGRS
source:
type: string
example: npm/mgrs
source_id:
type: array
items:
type: string
names:
type: object
properties:
default:
type: array
items:
type: string
display:
type: string
additionalProperty1:
type: object
additionalProperty1:
type: object
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/InternalError'
components:
responses:
BadRequest:
description: Invalid Request
content:
application/json:
schema:
$ref: '#/components/schemas/errorSchema'
Unauthorized:
description: Please provide a valid token
content:
application/json:
schema:
$ref: '#/components/schemas/errorSchema'
NotFound:
description: Resource Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/errorSchema'
Forbidden:
description: Token is not valid
content:
application/json:
schema:
$ref: '#/components/schemas/errorSchema'
InternalError:
description: Invalid Request
content:
application/json:
schema:
$ref: '#/components/schemas/errorSchema'
parameters:
xApiKey:
name: x-api-key
in: header
description: JWT authentication token provided by our team
schema:
type: string
token:
name: token
in: query
description: JWT authentication token provided by our team
schema:
type: string
disable_fuzziness:
name: disable_fuzziness
in: query
description: If an accurate result is obtained, only it will be returned
schema:
$ref: '#/components/schemas/disable_fuzziness'
limit:
name: limit
in: query
description: Maximum number of results
schema:
default: 5
minimum: 1
maximum: 15
type: number
geo_context:
in: query
name: geo_context
description: |-
Geo context of search.
Supported queries:
* bounding box:</br>
{"bbox":[minX,minY,maxX,maxY]}
* By point and radius (WGS84 and UTM are supported) </br>
{"lon":value,"lat":value,"radius":value}<br>
{"x":value,"y":value,"zone": number, "radius":value}
schema:
$ref: '#/components/schemas/geo_context'
geo_context_mode:
name: geo_context_mode
in: query
description: >-
Choose whether geo_context query parameter will be a filter or a bias
value
schema:
$ref: '#/components/schemas/geo_context_mode'
schemas:
errorSchema:
type: object
required:
- message
properties:
message:
type: string
status:
type: number
tileSchema:
type: object
properties:
type:
type: string
enum:
- Feature
geometry:
$ref: '#/components/schemas/Polygon'
properties:
type: object
required:
- TYPE
- TILE_NAME
properties:
TYPE:
type: string
TILE_NAME:
type: string
SUB_TILE_ID:
type: string
SUB_TILE_NUMBER:
type: array
items:
type: number
minimum: 0
maximum: 100
minItems: 3
maxItems: 3
mgrsTileSchema:
type: object
properties:
type:
type: string
enum:
- Feature
geocoding:
type: object
properties:
version:
type: string
example: 1.5.3
query:
type: object
properties:
tile:
type: string
example: 18SUJ2339007393
response:
type: object
properties:
max_score:
type: number
example: 1
results_count:
type: number
example: 1
match_latency_ms:
type: number
bbox:
$ref: '#/components/schemas/BoundingBox'
geometry:
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/Polygon'
- $ref: '#/components/schemas/MultiPolygon'
properties:
type: object
properties:
matches:
type: array
items:
type: object
properties:
layer:
type: string
example: MGRS
source:
type: string
example: npm/mgrs
source_id:
type: array
items:
type: string
names:
type: object
properties:
default:
type: array
items:
type: string
display:
type: string
score:
type: number
example: 1
tilesSchema:
allOf:
- $ref: '#/components/schemas/genericGeocodingResponse'
- type: object
description: GeoJson feature collection representing a tile (Polygon)
required:
- type
- features
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
$ref: '#/components/schemas/tileSchema'
itemsSchema:
allOf:
- $ref: '#/components/schemas/genericGeocodingResponse'
- type: object
description: GeoJson feature collection representing an item
required:
- type
- features
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
type: object
properties:
geometry:
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/Polygon'
properties:
type: object
required:
- TYPE
- OBJECT_COMMAND_NAME
- ENTITY_HEB
- SUB_TILE_ID
properties:
TYPE:
type: string
OBJECT_COMMAND_NAME:
type: string
ENTITY_HEB:
type: string
TILE_NAME:
type: string
SUB_TILE_ID:
type: string
routesSchema:
allOf:
- $ref: '#/components/schemas/genericGeocodingResponse'
- type: object
description: >-
GeoJson feature collection representing a route (MultiLineString,
LineString)
required:
- type
- features
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
type: object
properties:
geometry:
oneOf:
- $ref: '#/components/schemas/LineString'
- $ref: '#/components/schemas/MultiLineString'
properties:
type: object
required:
- TYPE
- OBJECT_COMMAND_NAME
- ENTITY_HEB
properties:
TYPE:
type: string
OBJECT_COMMAND_NAME:
type: string
ENTITY_HEB:
type: string
SECTION:
type: string
genericGeocodingResponse:
type: object
description: GeoJson feature collection representing an item
required:
- type
- features
- geocoding
properties:
type:
type: string
enum:
- FeatureCollection
geocoding:
type: object
required:
- query
- response
properties:
version:
type: string
pattern: ^\d{3}\.\d{3}\.\d{3}$
example: 1.5.3
query:
type: object
required:
- text
- limit
- geo_context
- disable_fuzziness
properties:
limit:
type: integer
minimum: 1
maximum: 10
geo_context:
$ref: '#/components/schemas/geo_context'
geo_context_mode:
$ref: '#/components/schemas/geo_context_mode'
disable_fuzziness:
$ref: '#/components/schemas/disable_fuzziness'
response:
type: object
required:
- max_score
- results_count
- match_latency
properties:
max_score:
type: number
minimum: 0
maximum: 100
results_count:
type: integer
minimum: 0
maximum: 10
match_latency_ms:
type: integer
minimum: 0
maximum: 5000
bbox:
$ref: '#/components/schemas/BoundingBox'
features:
type: array
items:
type: object
properties:
geometry:
$ref: '#/components/schemas/Geometry'
properties:
type: object
additionalProperties: true
required:
- id
- score
- matches
- regions
- display_name
- names
properties:
score:
type: number
minimum: 0
maximum: 100
matches:
type: array
items:
type: object
required:
- id
- source
- layer
properties:
layer:
type: string
source:
type: string
source_id:
type: array
items:
type: string
names:
type: object
required:
- display
- default
additionalProperties:
type: array
minItems: 1
maxItems: 100
items:
type: string
properties:
display:
type: string
default:
type: array
minItems: 1
items:
type: string
regions:
type: array
minItems: 1
maxItems: 100
items:
type: object
required:
- name
- sub_regions_names
properties:
name:
type: string
sub_regions_names:
type: array
minItems: 0
maxItems: 100
items:
type: string
minLength: 1
maxLength: 100
Geometry:
type: object
description: Geojson geometry
discriminator:
propertyName: type
required:
- type
externalDocs:
url: http://geojson.org/geojson-spec.html#geometry-objects
properties:
type:
type: string
enum:
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
description: the geometry type
Point3D:
type: array
description: Point in 3D space
externalDocs:
url: http://geojson.org/geojson-spec.html#id2
minItems: 2
maxItems: 3
items:
type: number
Point:
type: object
description: Geojson geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id2
allOf:
- $ref: '#/components/schemas/Geometry'
- properties:
coordinates:
$ref: '#/components/schemas/Point3D'
LineString:
type: object
description: Geojson geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id3
allOf:
- $ref: '#/components/schemas/Geometry'
- properties:
coordinates:
type: array
items:
$ref: '#/components/schemas/Point3D'
Polygon:
type: object
description: Geojson geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id4
allOf:
- $ref: '#/components/schemas/Geometry'
- properties:
coordinates:
type: array
items:
type: array
items: