-
Notifications
You must be signed in to change notification settings - Fork 0
/
places-api-v1.yaml
1139 lines (1119 loc) · 36.5 KB
/
places-api-v1.yaml
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.3
info:
version: 0.1.0
title: Monki Projects' Places API
servers:
- description: Monki Projects' Places API v1 (production)
url: 'https://api.monkiprojects.com/places/v1'
- description: Monki Projects' Places API v1 (staging / development)
url: 'https://staging.api.monkiprojects.com/places/v1'
tags:
- name: places
description: Endpoints related to places.
# - name: place-submission
# description: Endpoints related to place submissions.
- name: localized
description: Endpoints with localizable responses.
paths:
'/':
post:
summary: Create Place
description: Creates a place.
operationId: createPlace
tags: [places, localized]
security:
- BearerAuth: []
parameters:
- $ref: 'parameters.yaml#/Locale'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Place.Create'
responses:
'201':
$ref: '#/components/responses/CreatePlace_Success'
'400':
$ref: '#/components/responses/CreatePlace_BadRequest'
'401':
$ref: '#/components/responses/Unauthorized_BearerAuth'
get:
summary: List Places
description: >-
Lists all published places by default. If a `state` query parameter
is set, this endpoint will list all places in the specified state.
operationId: listPlaces
tags: [places, localized]
parameters:
- $ref: 'parameters.yaml#/PaginatePage'
- $ref: 'parameters.yaml#/PaginatePerPage'
- $ref: '#/components/parameters/PlaceState'
# - $ref: '#/components/parameters/PlacesOrder'
- $ref: 'parameters.yaml#/Locale'
responses:
'200':
$ref: '#/components/responses/ListPlaces_Success'
'400':
$ref: '#/components/responses/ListPlaces_BadRequest'
'401':
$ref: '#/components/responses/Unauthorized_BearerAuth'
'403':
$ref: '#/components/responses/ListPlaces_Forbidden'
'/{placeId}':
get:
summary: Get Place
description: Gets a place's details.
operationId: getPlace
tags: [places, localized]
parameters:
- $ref: '#/components/parameters/PlaceId'
- $ref: 'parameters.yaml#/Locale'
responses:
'200':
$ref: '#/components/responses/GetPlace_Success'
'404':
$ref: '#/components/responses/GetPlace_NotFound'
delete:
summary: Delete Place
description: Deletes a place.
operationId: deletePlace
tags: [places]
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/PlaceId'
responses:
'204':
description: Successfully Deleted
'401':
$ref: '#/components/responses/Unauthorized_BearerAuth'
'403':
$ref: '#/components/responses/DeletePlace_Forbidden'
'404':
$ref: '#/components/responses/DeletePlace_NotFound'
# '/{placeId}/submit':
# post:
# summary: Submit Place
# description: Submits a place.
# operationId: submitPlace
# tags: [places, place-submission]
# security:
# - BearerAuth: []
# parameters:
# - $ref: '#/components/parameters/PlaceId'
# responses:
# '200':
# $ref: '#/components/responses/SubmitPlace_Success'
# '401':
# $ref: '#/components/responses/Unauthorized_BearerAuth'
# '403':
# $ref: '#/components/responses/SubmitPlace_Forbidden'
# '404':
# $ref: '#/components/responses/SubmitPlace_NotFound'
# '/{placeId}/submission':
# get:
# summary: Get Place Submission Report
# description: Get a place's submission report.
# operationId: getPlaceSubmissionReport
# tags: [places, place-submission]
# parameters:
# - $ref: '#/components/parameters/PlaceId'
# responses:
# '200':
# $ref: '#/components/responses/GetPlaceSubmissionReport_Success'
# '404':
# $ref: '#/components/responses/GetPlaceSubmissionReport_NotFound'
# '412':
# $ref: '#/components/responses/GetPlaceSubmissionReport_PreconditionFailed'
# '/{placeId}/submission/reviews':
# post:
# summary: Add Place Submission Review
# description: Adds a submission review to a place.
# operationId: addPlaceSubmissionReview
# tags: [places, place-submission]
# security:
# - BearerAuth: []
# parameters:
# - $ref: '#/components/parameters/PlaceId'
# requestBody:
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Place.Submission.Review.Create'
# responses:
# '200':
# $ref: '#/components/responses/AddPlaceSubmissionReview_Success'
# '400':
# $ref: '#/components/responses/AddPlaceSubmissionReview_BadRequest'
# '401':
# $ref: '#/components/responses/Unauthorized_BearerAuth'
# '403':
# $ref: '#/components/responses/AddPlaceSubmissionReview_Forbidden'
# '404':
# $ref: '#/components/responses/AddPlaceSubmissionReview_NotFound'
# '412':
# $ref: '#/components/responses/AddPlaceSubmissionReview_PreconditionFailed'
# get:
# summary: List Place Submission Reviews
# description: Lists a place's submission reviews.
# operationId: listPlaceSubmissionReviews
# tags: [places, place-submission]
# parameters:
# - $ref: '#/components/parameters/PlaceId'
# - $ref: 'parameters.yaml#/PaginatePage'
# - $ref: 'parameters.yaml#/PaginatePerPage'
# - $ref: '#/components/parameters/PlaceSubmissionReviewOpinion'
# # - $ref: '#/components/parameters/PlaceSubmissionReviewsOrder'
# responses:
# '200':
# $ref: '#/components/responses/ListPlaceSubmissionReviews_Success'
# '401':
# $ref: '#/components/responses/Unauthorized_BearerAuth'
# '404':
# $ref: '#/components/responses/ListPlaceSubmissionReviews_NotFound'
# '412':
# $ref: '#/components/responses/ListPlaceSubmissionReviews_PreconditionFailed'
'/properties':
get:
summary: List Available Place Properties
description: Lists available place properties by kind.
operationId: listPlaceProperties
tags: [places, localized]
parameters:
- $ref: '#/components/parameters/PlacePropertyKind'
- $ref: 'parameters.yaml#/Locale'
responses:
'200':
$ref: '#/components/responses/ListPlaceProperties_Success'
'400':
$ref: '#/components/responses/ListPlaceProperties_BadRequest'
components:
parameters:
# ===== Places =====
PlaceId:
in: path
name: placeId
description: A unique place identifier.
required: true
schema:
$ref: '#/components/schemas/Place.ID'
PlaceState:
in: query
name: state
description: A state to filter places. Default is 'published'.
schema:
$ref: '#/components/schemas/Place.State'
PlacePropertyKind:
in: query
name: kind
description: A kind to filter properties.
required: true
schema:
$ref: '#/components/schemas/Place.Property.Kind'
# PlacesOrder:
# in: query
# name: sort_by
# description: The results order. If not set, results won't be ordered.
# schema:
# $ref: '#/components/schemas/PlacesOrder'
# === Place Submissions ===
# PlaceSubmissionReviewOpinion:
# in: query
# name: opinion
# description: >-
# An opinion to filter place submission reviews.
# If not set, results won't be filtered.
# schema:
# $ref: '#/components/schemas/Place.Submission.Review.Opinion'
# PlaceSubmissionReviewsOrder:
# in: query
# name: sort_by
# description: The results order. If not set, results won't be ordered.
# schema:
# $ref: '#/components/schemas/PlaceSubmissionReviewsOrder'
schemas:
# ===== Atoms =====
# === Places ===
Place.ID:
$ref: 'schemas.yaml#/ID'
Place.State:
description: The state in which a place is.
type: string
enum: [unknown, draft, local, private, submitted, published, rejected]
Place.Name:
description: A place `name`.
type: string
minLength: 3
maxLength: 48
Place.Caption:
description: A place `caption`. Possibly empty.
type: string
nullable: true
example: 'A great training spot with good walls of different sizes.'
Place.City:
description: The city in which a place is.
type: string
minLength: 1
example: 'Nantes'
Place.Country:
description: The city in which a place is.
type: string
minLength: 1
example: 'France'
# === Place Categories ===
Place.Category.ID:
description: A place category `ID`.
type: string
enum: [unknown, spot, facility, misc]
# === Place Kinds ===
Place.Kind.ID:
description: A place kind `ID`.
type: string
pattern: '^(?:[a-z0-9]+_)*[a-z0-9]+$'
# === Place Properties ===
Place.Property.ID:
description: A place property `ID`.
type: string
pattern: '^(?:[a-z0-9]+\+?_)*[a-z0-9]+$'
example: small_wall
Place.Property.Kind:
description: A place property kind.
type: string
enum: [feature, technique, benefit, hazard]
# === Place Issues ===
# Place.Issue:
# description: A place issue.
# type: object
# required: [id, place, issuer, reason, comment, state, created_at]
# properties:
# id:
# $ref: 'schemas.yaml#/ID'
# place:
# $ref: 'schemas.yaml#/ID'
# issuer:
# $ref: 'schemas.yaml#/ID'
# reason:
# $ref: '#/components/schemas/Place.Issue.Reason'
# comment:
# $ref: '#/components/schemas/Place.Issue.Comment'
# state:
# $ref: '#/components/schemas/Place.Issue.State'
# created_at:
# $ref: 'schemas.yaml#/DateTime'
# example:
# $ref: '#/components/examples/PlaceIssue1'
# Place.Issue.Comment:
# description: A comment in a place issue.
# type: string
# minLength: 4
# example: There is no tree on this spot!
# Place.Issue.Reason:
# description: 'The reason of a place issue. For unhandled cases, use `other`.'
# type: string
# enum: [name, location, type, caption, satellite_image, images, address, properties, other]
# Place.Issue.State:
# description: The state of a place issue.
# type: string
# enum: [submitted, addressed, denied]
# === Place Submissions ===
# Place.Submission.State:
# description: The state of a place submission.
# type: string
# enum: [waiting_for_reviews, needs_changes, waiting_for_changes, accepted, rejected, moderated]
# Place.Submission.Review.Opinion:
# description: A user's opinion in a submission review.
# type: string
# enum: [positive, needs_changes, negative]
# ===== Molecules =====
Place.Category.Localized:
description: A localized place `category`.
type: object
required: [id, title]
properties:
id:
$ref: '#/components/schemas/Place.Category.ID'
title:
$ref: '#/components/schemas/LocalizedTitle'
example:
id: facility
title: Salle
Place.Kind.Localized:
description: A localized place `kind`.
type: object
required: [id, title]
properties:
id:
$ref: '#/components/schemas/Place.Kind.ID'
title:
$ref: '#/components/schemas/LocalizedTitle'
example:
id: training_spot
title: Lieu d'entraînement
Place.Property.Localized:
description: A localized place property.
type: object
required: [id, title, kind]
properties:
id:
$ref: '#/components/schemas/Place.Property.ID'
title:
$ref: '#/components/schemas/LocalizedTitle'
kind:
$ref: '#/components/schemas/Place.Property.Kind'
# example:
# $ref: '#/components/examples/Feature1'
Place.Location.Public:
description: The location (address) of a place.
type: object
required: [city, country]
properties:
city:
$ref: '#/components/schemas/Place.City'
country:
$ref: '#/components/schemas/Place.Country'
# ===== Organisms =====
Place.Create:
description: An object with data required to create a new place.
type: object
required: [name, latitude, longitude, kind, properties]
properties:
name:
$ref: '#/components/schemas/Place.Name'
latitude:
$ref: '#/components/schemas/Latitude'
longitude:
$ref: '#/components/schemas/Longitude'
kind:
$ref: '#/components/schemas/Place.Kind.ID'
caption:
$ref: '#/components/schemas/Place.Caption'
images:
$ref: '#/components/schemas/ArrayOfImageURLs'
properties:
$ref: '#/components/schemas/ArrayOfPlaceProperties'
Place.Public:
description: A place, with all its details.
type: object
required: [id, name, latitude, longitude, kind, category, state, creator, details, created_at, updated_at]
properties:
id:
$ref: 'schemas.yaml#/ID'
name:
$ref: '#/components/schemas/Place.Name'
latitude:
$ref: '#/components/schemas/Latitude'
longitude:
$ref: '#/components/schemas/Longitude'
kind:
$ref: '#/components/schemas/Place.Kind.ID'
category:
$ref: '#/components/schemas/Place.Category.ID'
state:
$ref: '#/components/schemas/Place.State'
creator:
$ref: 'users-api-v1.yaml#/components/schemas/User.ID'
details:
$ref: '#/components/schemas/Place.Details.Public'
created_at:
$ref: 'schemas.yaml#/DateTime'
updated_at:
$ref: 'schemas.yaml#/DateTime'
Place.Details.Public:
description: The details of a place.
type: object
required: [caption, satellite_image, images, properties]
properties:
caption:
$ref: '#/components/schemas/Place.Caption'
satellite_image:
$ref: 'schemas.yaml#/ImageURL'
images:
$ref: '#/components/schemas/ArrayOfImageURLs'
location:
$ref: '#/components/schemas/Place.Location.Public'
properties:
$ref: '#/components/schemas/ArrayOfPlaceProperties'
# Place.Submission.Review.Create:
# description: An object with data required to create a new place submission review.
# type: object
# required: [opinion, comment]
# properties:
# opinion:
# $ref: '#/components/schemas/Place.Submission.Review.Opinion'
# comment:
# $ref: '#/components/schemas/Review.Comment'
# issues:
# $ref: '#/components/schemas/ArrayOfPlaceIssues'
# moderated:
# $ref: '#/components/schemas/ModeratedFlag'
# example:
# $ref: '#/components/examples/CreatePlaceSubmissionReview1'
# Place.Submission.Review:
# description: A place submission review.
# type: object
# required: [id, place, reviewer, opinion, comment, created_at]
# properties:
# id:
# $ref: 'schemas.yaml#/ID'
# place:
# $ref: 'schemas.yaml#/ID'
# reviewer:
# $ref: 'schemas.yaml#/ID'
# opinion:
# $ref: '#/components/schemas/Place.Submission.Review.Opinion'
# comment:
# $ref: '#/components/schemas/Review.Comment'
# issues:
# $ref: '#/components/schemas/ArrayOfPlaceIssues'
# moderated:
# $ref: '#/components/schemas/ModeratedFlag'
# created_at:
# $ref: 'schemas.yaml#/DateTime'
# example:
# $ref: '#/components/examples/PlaceSubmissionReview1'
# Place.Submission.Report:
# description: A report about a place submission.
# type: object
# required: [id, place, state, reviews, created_at, updated_at]
# properties:
# id:
# $ref: 'schemas.yaml#/ID'
# place:
# $ref: 'schemas.yaml#/ID'
# state:
# $ref: '#/components/schemas/Place.Submission.State'
# reviews:
# $ref: '#/components/schemas/ArrayOfPlaceSubmissionReviews'
# created_at:
# $ref: 'schemas.yaml#/DateTime'
# updated_at:
# $ref: 'schemas.yaml#/DateTime'
# example:
# $ref: '#/components/examples/PlaceSubmissionReport1'
# ===== Arrays =====
ArrayOfPlaces:
description: An array of places.
type: array
# uniqueItems: true
items:
$ref: '#/components/schemas/Place.Public'
# example:
# - $ref: '#/components/examples/Spot1'
# - $ref: '#/components/examples/Spot2'
ArrayOfPlacePropertyIDs:
description: An array of place property `ID`s.
type: array
uniqueItems: true
items:
$ref: '#/components/schemas/Place.Property.ID'
example:
- grass
- small_wall
- stairs
ArrayOfPlaceProperties:
description: An array of place properties.
type: array
uniqueItems: true
items:
$ref: '#/components/schemas/Place.Property.Localized'
# example:
# - $ref: '#/components/examples/Feature1'
# - $ref: '#/components/examples/Feature2'
# ArrayOfPlaceIssues:
# description: An array of place issues.
# type: array
# uniqueItems: true
# items:
# $ref: '#/components/schemas/Place.Issue'
# example:
# - $ref: '#/components/examples/PlaceIssue1'
# - $ref: '#/components/examples/PlaceIssue2'
# ArrayOfPlaceSubmissionReviews:
# description: An array of place submission reviews.
# type: array
# uniqueItems: true
# items:
# $ref: '#/components/schemas/Place.Submission.Review'
# example:
# - $ref: '#/components/examples/PlaceSubmissionReview1'
# - $ref: '#/components/examples/PlaceSubmissionReview2'
ArrayOfImageURLs:
description: An array of image `URL`s.
type: array
# uniqueItems: true
maxItems: 48
items:
$ref: 'schemas.yaml#/ImageURL'
# ===== Pagination =====
# === Paginated Arrays ===
PlacesPage:
description: A paginated array of places.
type: object
required: [items, metadata]
properties:
items:
$ref: '#/components/schemas/ArrayOfPlaces'
metadata:
$ref: 'schemas.yaml#/PaginateMetadata'
# PlaceSubmissionReviewsPage:
# description: A paginated array of place submission reviews.
# type: object
# required: [items, metadata]
# properties:
# items:
# $ref: '#/components/schemas/ArrayOfPlaceSubmissionReviews'
# metadata:
# $ref: 'schemas.yaml#/PaginateMetadata'
# === Ordering ===
# PlacesOrder:
# description: >-
# The order of the places in an array:
# * `last_created`: From the latest created place to the oldest one
# * `first_created`: From the first created place to the latest one
# * `last_published`: From the latest published place to the first one
# * `first_published`: From the first published place to the last one
# **Note:** Creation date and publication date are very different:
# One could have created a place a while ago but published it just recently.
# type: string
# enum: [last_created, first_created, last_published, first_published]
# PlaceSubmissionReviewsOrder:
# description: >-
# The order of the place submission reviews in an array:
# * `last_created`: From the latest created review to the oldest one
# * `first_created`: From the first created review to the latest one
# type: string
# enum: [last_created, first_created]
# ===== Misc =====
LocalizedTitle:
description: A localized `title`.
type: string
minLength: 1
Latitude:
description: The latitude component of a coordinate.
type: number
format: double
minimum: -90
maximum: 90
Longitude:
description: The longitude component of a coordinate.
type: number
format: double
minimum: -180
maximum: 180
Review.Comment:
description: A review comment. Possibly empty.
type: string
example: 'Great spot, very diverse! I like to go there for long training sessions.'
ModeratedFlag:
description: A flag saying something has been moderated.
type: boolean
example: true
responses:
Unauthorized_BearerAuth:
description: Unauthorized
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
No auth provided:
$ref: '#/components/examples/BearerAuthNoAuthError'
Invalid auth type:
$ref: '#/components/examples/BearerAuthInvalidAuthType'
Invalid token:
$ref: '#/components/examples/BearerAuthInvalidToken'
CreatePlace_Success:
description: Successfully Created
content:
application/json:
schema:
$ref: '#/components/schemas/Place.Public'
examples:
Created place:
$ref: '#/components/examples/NewPlace'
CreatePlace_BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Missing field:
$ref: '#/components/examples/CreatePlaceMissingFieldError'
Name too small:
$ref: '#/components/examples/PlaceNameTooSmallError'
Invalid coordinates:
$ref: '#/components/examples/InvalidCoordinatesError'
Invalid kind:
$ref: '#/components/examples/PlaceKindNotFoundError'
Invalid property:
$ref: '#/components/examples/InvalidPlacePropertyError'
ListPlaces_Success:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/PlacesPage'
ListPlaces_BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Invalid state query param:
$ref: '#/components/examples/InvalidPlaceStateError'
ListPlaces_Forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Private state:
value: {
"error": true,
"reason": "You cannot list private places without being authenticated"
}
GetPlace_Success:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Place.Public'
GetPlace_NotFound:
description: Not Found
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Place not found:
$ref: '#/components/examples/PlaceNotFoundError'
DeletePlace_Forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Not your place:
$ref: '#/components/examples/CannotDeleteSomeoneElsesPlaceError'
DeletePlace_NotFound:
description: Not Found
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Place not found:
$ref: '#/components/examples/PlaceNotFoundError'
# SubmitPlace_Success:
# description: Successfully Submitted
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Place.Submission.Report'
# SubmitPlace_Forbidden:
# description: Forbidden
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Not your place:
# $ref: '#/components/examples/CannotSubmitSomeoneElsesPlaceError'
# Already submitted:
# $ref: '#/components/examples/CannotSubmitPlaceTwiceError'
# SubmitPlace_NotFound:
# description: Not Found
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not found:
# $ref: '#/components/examples/PlaceNotFoundError'
# GetPlaceSubmissionReport_Success:
# description: Success
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Place.Submission.Report'
# GetPlaceSubmissionReport_NotFound:
# description: Not Found
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not found:
# $ref: '#/components/examples/PlaceNotFoundError'
# GetPlaceSubmissionReport_PreconditionFailed:
# description: Precondition Failed
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not submitted:
# $ref: '#/components/examples/PlaceNotSubmittedError'
# AddPlaceSubmissionReview_Success:
# description: Success
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Place.Submission.Review'
# AddPlaceSubmissionReview_BadRequest:
# description: Bad Request
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# # TODO: Add examples
# AddPlaceSubmissionReview_Forbidden:
# description: Not Found
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not found:
# $ref: '#/components/examples/ForbiddenModeratedFlagError'
# AddPlaceSubmissionReview_NotFound:
# description: Not Found
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not found:
# $ref: '#/components/examples/PlaceNotFoundError'
# AddPlaceSubmissionReview_PreconditionFailed:
# description: Precondition Failed
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not submitted:
# $ref: '#/components/examples/PlaceNotSubmittedError'
# ListPlaceSubmissionReviews_Success:
# description: Success
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/PlaceSubmissionReviewsPage'
# ListPlaceSubmissionReviews_NotFound:
# description: Not Found
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not found:
# $ref: '#/components/examples/PlaceNotFoundError'
# ListPlaceSubmissionReviews_PreconditionFailed:
# description: Precondition Failed
# content:
# application/json:
# schema:
# $ref: 'schemas.yaml#/Error'
# examples:
# Place not submitted:
# $ref: '#/components/examples/PlaceNotSubmittedError'
ListPlaceProperties_Success:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfPlaceProperties'
# TODO: Add examples
ListPlaceProperties_BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: 'schemas.yaml#/Error'
examples:
Invalid property kind:
$ref: '#/components/examples/InvalidPlacePropertyKindError'
examples:
NewPlace:
summary: Newly created place
value: {
"latitude": 48.8583,
"longitude": 2.2945,
"category": "spot",
"kind": "training_spot",
"creator": "D9CFF0B0-75DA-4A59-9BDB-A268299F4C97",
"details": {
"images": [],
"satellite_image": "https://res.cloudinary.com/monki-projects/image/upload/f_auto/satellite_images/satellite-view-placeholder.jpg",
"caption": "Test caption",
"properties": [
{
"id": "small_wall",
"title": "Small Wall",
"kind": "feature"
}
]
},
"created_at": "2021-03-10T09:01:04Z",
"state": "private",
"id": "FD58CE36-5504-4743-8E9F-955A6D18DAA1",
"updated_at": "2021-03-10T09:01:04Z",
"name": "Test place"
}
Spot1:
summary: Example spot
value:
id: 4f9058b3-3f8f-4b10-b3c0-e28c654012e4
name: Espace de street workout Vincent Gâche
latitude: 47.207423
longitude: -1.547817
kind:
id: calisthenics_park
title: Parc de street workout
locale: fr-FR
category:
id: spot
title: Spot
locale: fr-FR
state: published
created_at: '2020-12-02T01:43:52.285Z'
updated_at: '2020-12-22T22:26:11.618Z'
Spot2:
summary: Example spot
value:
id: 31256d06-7786-4555-8592-ec20e9c9cdfb
name: Porte des deux moulins
latitude: 46.155295
longitude: -1.159034
kind:
id: training_spot
title: Lieu d'entraînement
locale: fr-FR
category:
id: spot
title: Spot
locale: fr-FR
state: published
created_at: '2020-04-15T15:28:41.729Z'
updated_at: '2020-04-15T15:28:41.729Z'
Feature1:
summary: Example place feature
value:
id: grass
title: Herbe
locale: fr-FR
Feature2:
summary: Example place feature
value:
id: small_wall
title: Petit mur
locale: fr-FR
Technique1:
summary: Example technique
value:
id: double_kong
title: Double saut de chat
locale: fr-FR
Technique2:
summary: Example technique
value:
id: precision_jump
title: Saut de précision
locale: fr-FR
Benefit1:
summary: Example place benefit
value:
id: covered_area
title: Espace couvert
locale: fr-FR
Benefit2:
summary: Example place benefit
value:
id: drinking_fountain
title: Fontaine à eau
locale: fr-FR
Hazard1:
summary: Example place hazard
value:
id: security
title: Sécurité
locale: fr-FR
Hazard2:
summary: Example place hazard
value:
id: security_cam
title: Caméra de sécurité
locale: fr-FR
# CreatePlaceSubmissionReview1:
# summary: Example place submission review creation
# value:
# opinion: positive
# comment: Everything looks good.
# PlaceSubmissionReview1:
# summary: Example place submission review
# value:
# id: 5881cf6b-1d3a-48d2-a84c-9a625adbea20
# place: f6236b3a-65f1-4157-84f7-f22d6cff8a0a
# reviewer: e8636f06-5a1c-45a2-b1e9-5a693c98c9c8
# opinion: positive
# comment: ''
# created_at: '2020-09-23T07:46:57.524Z'
# PlaceSubmissionReview2:
# summary: Example place submission review
# value:
# id: b1e642f9-f0cd-4169-bd3f-2441f37b2b88
# place: 2f5bdf5a-8695-4ace-8def-41ba9f632a97
# reviewer: 0350cf76-44ab-480c-8e62-77b47b386827
# opinion: negative
# comment: 'I know this place, there''s no spot here! This should not be accepted.'
# issues:
# - $ref: '#/components/examples/PlaceLocationIssue'
# created_at: '2020-10-05T09:23:21.836Z'
# PlaceSubmissionReport1:
# summary: Example place submission report
# value:
# id: 24ffb61e-ad56-4244-bbd5-673944e74116
# place: 6af987db-b1f9-4f9d-ab2e-c330b4ec78bd
# reviews:
# - $ref: '#/components/examples/PlaceSubmissionReview1'
# - $ref: '#/components/examples/PlaceSubmissionReview2'
# created_at: '2020-09-23T07:46:57.524Z'
# updated_at: '2020-10-05T09:23:21.836Z'