-
Notifications
You must be signed in to change notification settings - Fork 1
/
paatos.swagger.yaml
1276 lines (1240 loc) · 37.9 KB
/
paatos.swagger.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
swagger: '2.0'
info:
title: Open Decisions API
description: API for distributing data about decisions and people behind those decisions
termsOfService: (depends on authority providing the data)
version: 0.0.5
# during dev, should point to your local machine
host: paatos-test.6aika.fi
# basePath prefixes all resource paths
basePath: /v1
schemes:
- https
produces:
- application/json
parameters:
page_param:
name: page
in: query
description: request particular page in paginated results
required: false
type: integer
pagesize_param:
name: page_size
in: query
description: request that server delivers page_size results in response
required: false
type: integer
definitions:
Meta:
type: object
title: Pagination control
description: Meta structure for controlling pagination
properties:
previous:
type: string
description: Uri of the previous page relative to the current page settings.
total_count:
type: integer
description: Total items count for the all collection
offset:
type: integer
description: Specify the offset to start displaying element on a page.
limit:
type: integer
description: Specify the number of element to display per page.
next:
type: string
description: Uri of the next page relative to the current page settings.
case:
type: object
title: 'High level matter to be decided ("Asia")'
description: 'A matter being decided withing the organization. These are often considered across multiple meetings and possibly across multiple decision makers. Cases can also be related to other cases, forming more complex structures. All that said, it is not unusual for a case to involve only a single action. Previous version used *issue* as similar concept, without interlinking.'
properties:
url:
description: The case's url
type: string
id:
description: The case's unique identifier
type: number
format: int64
data_source:
description: The case's data source
type: string
actions:
description: Array of urls to actions
type: array
items:
type: string
geometries:
description: Array of geometries
type: array
items:
$ref: '#/definitions/geometry'
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The event's origin id
type: string
title:
description: Title of the case
type: string
register_id:
description: Register id for this case
type: string
function:
description: Function url for this case
type: string
attachments:
description: Array of attachments
type: array
items:
$ref: '#/definitions/attachment'
action:
type: object
title: An action taken by a decision maker.
description: 'An action taken by a decision maker. Except for formalities (like quorum), these always involve a case and a decision by an organization or post, even if only postponing the decision. For decision making bodies, actions are always taken in context of a meeting. For officials, some cities also publish their decisions as being done in a meeting, although there is only one person present.'
properties:
url:
description: The action's url
type: string
id:
description: The action's unique identifier
type: number
format: int64
data_source:
description: The action's data source
type: string
contents:
description: Array of contents
type: array
items:
$ref: '#/definitions/content'
attachments:
description: Array of attachments
type: array
items:
$ref: '#/definitions/attachment'
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The event's origin id
type: string
title:
description: Title of the action
type: string
ordering:
description: Ordering of this action within a meeting (or possibly arbitrary ordering)
type: integer
article_number:
description: The article number given to this action after decision, will be null before decision
type: string
resolution:
description: Action's resolution
type: string
case:
description: Case url this action is related to
type: string
post:
description: Post url
type: string
event:
description: Event url this action is related to
type: string
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
# Event is to be used for meetings and also votes within actions
Event:
title: Event
description: An occurrence that people may attend
type: object
properties:
url:
description: The event's url
type: string
id:
description: The event's unique identifier
type: number
format: int64
data_source:
description: The event's data source
type: string
actions:
description: The evvent's actions
type: array
items:
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The event's origin id
type: string
name:
description: The event's name
type: string
start_date:
description: The time at which the event starts
type: string
format: date
end_date:
description: The time at which the event ends
type: string
format: date
organization:
description: The url of the organization organizing the event
type: string
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
Vote_event:
title: Vote event
description: An event at which people's votes are recorded
type: object
properties:
id:
description: The vote event's unique identifier
type: string
organization_id:
description: The ID of the organization whose members are voting
type: string
organization:
description: The organization whose members are voting
$ref: '#/definitions/Organization'
legislative_session:
description: IRI reference to the Event (meeting) where this vote took place
$ref: '#/definitions/Event'
identifier:
description: An issued identifier
type: string
action:
description: The action to which this vote_event applies.
$ref: '#/definitions/action'
start_date:
description: The time at which the event begins
type: string
format: date-time
end_date:
description: The time at which the event ends
type: string
format: date-time
result:
description: The result of the vote event.
type: string
# group_results:
# description: '(6Aika note: this might not useful. Remove?) The result of the vote event within groups of voters.'
# type: array
# items:
# $ref: '#/definitions/group_result'
counts:
description: The number of votes for options
type: array
items:
$ref: '#/definitions/Vote_count'
# (6Aika note: leaving out for first edition)
# votes:
# description: Voters' votes
# type: array
# items:
# $ref: '#/definitions/Vote'
created_at:
description: The time at which the resource was created
type: string
format: date-time
updated_at:
description: The time at which the resource was last modified
type: string
format: date-time
# (6Aika note: are these necessary?)
# sources:
# description: URLs to documents from which the resource is derived
# type: array
# items:
# $ref: '#/definitions/link'
Vote_count:
title: Count
description: The number of votes for an option in a vote event
type: object
required:
- option
- value
properties:
option:
description: An option in a vote event
type: string
value:
description: The number of votes for an option
type: integer
group_id:
description: The ID of a group of voters
type: string
group:
description: A group of voters
type: object
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
Organization:
title: Organization
description: A group with a common purpose or reason for existence that goes beyond the set of people belonging to it
type: object
properties:
url:
description: The organization's url
type: string
id:
description: The organization's unique identifier
type: number
format: int64
data_source:
description: The organization's data source
type: string
events:
description: The organization's events
type: array
items:
type: string
posts:
description: The organization's posts
type: array
items:
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The organization's origin id
type: string
classification:
description: The organization's classification
type: string
name:
description: The organization's name
type: string
founding_date:
description: The time at which the organization was founded
type: string
format: date
dissolution_date:
description: The time at which the organization was dissolved
type: string
format: date
parent:
description: The url of the organization's parent organization
type: string
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
Membership:
title: Membership
description: A relationship between a member and an organization
type: object
properties:
id:
description: The membership's unique identifier
type: string
label:
description: A label describing the membership
type: string
role:
description: The role that the member fulfills in the organization
type: string
member:
description: The person or organization that is a member of the organization
type: object
person_id:
description: The ID of the person who is a member of the organization
type: string
person:
description: The person who is a member of the organization
$ref: '#/definitions/Person'
# (6Aika note: not used)
# organization_id:
# description: The ID of the organization in which the person or organization is a member
# type: string
organization:
description: The organization in which the person or organization is a member
$ref: '#/definitions/Organization'
post_id:
description: The ID of the post held by the member in the organization through this membership
type: string
post:
description: The post held by the member in the organization through this membership
$ref: '#/definitions/Post'
# (6Aika note: not used)
# on_behalf_of_id:
# description: The ID of the organization on whose behalf the person is a member of the organization
# type: string
on_behalf_of:
description: The organization on whose behalf the person is a member of the organization
$ref: '#/definitions/Organization'
# (6Aika note: not needed for cities?)
# area_id:
# description: The ID of the geographic area to which this membership is related
# type: string
# area:
# description: The geographic area to which this membership is related
# $ref: '#/definitions/Area'
start_date:
description: The date on which the relationship began
type: string
format: date
end_date:
description: The date on which the relationship ended
type: string
format: date
# (6Aika note: left out for this version)
# contact_details:
# description: Means of contacting the member of the organization
# type: array
# items:
# $ref: '#/definitions/contact_detail'
# (6aika note: left out for this version)
# links:
# description: URLs to documents about the membership
# type: array
# items:
# $ref: '#/definitions/link'
created_at:
description: The time at which the resource was created
type: string
format: date-time
updated_at:
description: The time at which the resource was last modified
type: string
format: date-time
# (&aika note: left out for this version)
# sources:
# description: URLs to documents from which the resource is derived
# type: array
# items:
# $ref: '#/definitions/link'
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
Person:
title: Person
description: A real person, alive or dead
type: object
properties:
id:
description: The person's unique identifier
type: string
name:
description: A person's preferred full name
type: string
# (6Aika note: not used)
# other_names:
# description: Alternate or former names
# type: array
# items:
# $ref: '#/definitions/other_name'
# (6Aika note: not used)
# identifiers:
# description: Issued identifiers
# type: array
# items:
# $ref: '#/definitions/identifier'
family_name:
description: One or more family names
type: string
given_name:
description: One or more primary given names
type: string
additional_name:
description: One or more secondary given names
type: string
honorific_prefix:
description: One or more honorifics preceding a person's name
type: string
honorific_suffix:
description: One or more honorifics following a person's name
type: string
patronymic_name:
description: One or more patronymic names
type: string
sort_name:
description: A name to use in a lexicographically ordered list
type: string
email:
description: A preferred email address
type: string
format: email
gender:
description: A gender
type: string
birth_date:
description: A date of birth
type: string
format: date
death_date:
description: A date of death
type: string
format: date
image:
description: A URL of a head shot
type: string
format: uri
summary:
description: A one-line account of a person's life
type: string
biography:
description: An extended account of a person's life
type: string
national_identity:
description: A national identity
type: string
# (6Aika note: not used)
# contact_details:
# description: Means of contacting the person
# type: array
# items:
# $ref: '#/definitions/contact_detail'
# (6Aika note: not used)
# links:
# description: URLs to documents about the person
# type: array
# items:
# $ref: '#/definitions/link'
memberships:
description: The person's memberships
type: array
items:
$ref: '#/definitions/Membership'
# (6Aika note: motion structure is not used)
# motions:
# description: The person's motions
# type: array
# items:
# $ref: '#/definitions/Motion'
# (6Aika note: coming later)
# speeches:
# description: The person's speeches
# type: array
# items:
# $ref: '#/definitions/speech'
# (6Aika note: coming later)
# votes:
# description: Votes cast by the person
# type: array
# items:
# $ref: '#/definitions/Vote'
created_at:
description: The time at which the resource was created
type: string
format: date-time
updated_at:
description: The time at which the resource was last modified
type: string
format: date-time
# (6Aika note: not used)
# sources:
# description: URLs to documents from which the resource is derived
# type: array
# items:
# $ref: '#/definitions/link'
Post:
title: Post
description: A position that exists independent of the person holding it
type: object
properties:
id:
description: The post's unique identifier
type: string
label:
description: A label describing the post
type: string
other_label:
description: An alternate label
type: array
items:
type: string
role:
description: The function that the holder of the post fulfills
type: string
# (6Aika note: id is not used, only reference)
# organization_id:
# description: The ID of the organization in which the post is held
# type: string
organization:
description: The organization in which the post is held
$ref: '#/definitions/Organization'
area_id:
description: The ID of the geographic area to which this post is related
type: string
# (6Aika note: needs checking if the are posts with areas)
# area:
# description: The geographic area to which this post is related
# $ref: '#/definitions/Area'
start_date:
description: The date on which the post was created
type: string
format: date
end_date:
description: The date on which the post was eliminated
type: string
format: date
# (6Aika note: not used for now)
# contact_details:
# description: Means of contacting the holder of the post
# type: array
# items:
# $ref: '#/definitions/contact_detail'
# (6Aika note: not used for now)
# links:
# description: URLs to documents about the post
# type: array
# items:
# $ref: '#/definitions/link'
memberships:
description: The memberships through which people hold the post in the organization
type: array
items:
$ref: '#/definitions/Membership'
created_at:
description: The time at which the resource was created
type: string
format: date-time
updated_at:
description: The time at which the resource was last modified
type: string
format: date-time
# (6Aika note: not used for now)
# sources:
# description: URLs to documents from which the resource is derived
# type: array
# items:
# $ref: '#/definitions/link'
# this is derived from Popolo, converted to YAML and JSON Schema draft-04
Area:
title: Area
description: A geographic area whose geometry may change over time
type: object
properties:
id:
description: The area's unique identifier
type: string
name:
description: A primary name
type: string
identifier:
description: An issued identifier
type: string
classification:
description: An area category, e.g. city
type: string
parent_id:
description: The ID of the area that contains this area
type: string
parent:
description: The area that contains this area
$ref: '#/definitions/Area'
geometry:
description: A geometry
type: object
# (6Aika note: leaving out areas related to memberships for now)
# memberships:
# description: The memberships to which this area is related
# type: array
# items:
# $ref: '#/definitions/Membership'
# (6Aika note: same as with memberships, leaving out for now)
# organizations:
# description: The organizations to which this area is related
# type: array
# items:
# $ref: '#/definitions/Organization'
# (6Aika note: same as with memberships, although area related posts certainly exist)
# posts:
# description: The posts to which this area is related
# type: array
# items:
# $ref: '#/definitions/Post'
children:
description: The sub-areas of the area
type: array
items:
$ref: '#/definitions/Area'
created_at:
description: The time at which the resource was created
type: string
format: date-time
updated_at:
description: The time at which the resource was last modified
type: string
format: date-time
# (6Aika note: not used for now)
# sources:
# description: URLs to documents from which the resource is derived
# type: array
# items:
# $ref: '#/definitions/link'
content:
type: object
title: Text contents for actions and cases
description: Content objects contain the text describing actions takens on cases and the cases themselves. They consist of metadata and the actual content as HTML-formatted text.
properties:
data_source:
description: The content's data source
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The content's origin id
type: string
ordering:
description: Ordering of this content within the larger context
type: integer
title:
description: The content's title
type: string
type:
description: The content's type
type: string
hypertext:
description: 'Content formatted with pseudo-HTML. Only a very restricted set of tags is allowed. These are: first and second level headings (P+H1+H2) and table (more may be added, but start from a minimal set)'
type: string
attachment:
type: object
title: File attachment related to an action or a case
description: Both actions and cases can have related attachments. Usually, the attachments are accumulated in the case and also referenced in the action that attached them to the case.
properties:
url:
description: URL pointing the attached file
type: string
format: url
data_source:
description: The attachment's data source
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The attachment's origin id
type: string
name:
description: The attachment's name
type: string
public:
description: Is the attachment public
type: boolean
confidentiality_reason:
description: The attachment's confidentiality reason
type: string
function:
title: Function
description: A function
type: object
properties:
url:
description: The function's url
type: string
id:
description: The function's unique identifier
type: number
format: int64
data_source:
description: The function's data source
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The function's origin id
type: string
name:
description: The function's name
type: string
function_id:
description: The actual function id
type: string
parent:
description: URL to parent function
type: string
geometry:
type: object
title: Geometry object
description: Single geometry object
properties:
data_source:
description: The geometry's data source
type: string
created_at:
description: The time at which the resource was created
type: string
format: date-time
modified_at:
description: The time at which the resource was last modified
type: string
format: date-time
origin_id:
description: The geometry's origin id
type: string
name:
description: The geometry's name
type: string
type:
description: The geometry's type
type: string
geometry:
type: object
properties:
type:
description: Type
type: string
coordinates:
description: Array of GEO JSON coordinates
type: array
items:
type: object
paths:
/case/:
x-swagger-router-controller: cases
get:
summary: Retrieve a list of cases
operationId: cases_list
responses:
200:
description: List of cases
schema:
type: object
properties:
count:
type: integer
description: Total items count for the all collection
next:
type: string
description: Uri of the next page relative to the current page settings.
previous:
type: string
description: Uri of the previous page relative to the current page settings.
results:
type: array
items:
$ref: '#/definitions/case'
tags:
- cases
parameters:
- type: integer
in: query
required: false
name: limit
description: Specify the number of element to display per page.
- type: integer
in: query
required: false
name: offset
description: Specify the offset to start displaying element on a page.
/case/{id}/:
x-swagger-router-controller: cases
get:
summary: Retrieve a single case by ID
operationId: cases_retrieve
responses:
200:
description: A single case record
schema:
$ref: '#/definitions/case'
tags:
- cases
parameters:
- name: id
type: integer
in: path
required: true
description: Primary key of resource
/action/:
x-swagger-router-controller: actions
get:
summary: Retrieve a list of actions
operationId: actions_list
responses:
200:
description: List of actions
schema:
type: object
properties:
count:
type: integer
description: Total items count for the all collection
next:
type: string
description: Uri of the next page relative to the current page settings.
previous:
type: string
description: Uri of the previous page relative to the current page settings.
results:
type: array
items:
$ref: '#/definitions/action'
tags:
- actions
parameters:
- type: integer
in: query
required: false
name: limit
description: Specify the number of element to display per page.
- type: integer
in: query
required: false
name: offset
description: Specify the offset to start displaying element on a page.
/action/{id}/:
x-swagger-router-controller: actions
get:
summary: Retrieve a single action by ID
operationId: actions_retrieve
responses:
200:
description: A single action record
schema:
$ref: '#/definitions/action'
tags:
- actions
parameters:
- name: id
type: integer
in: path
required: true
description: Primary key of resource
/person/:
x-swagger-router-controller: persons
get:
summary: Retrieve a list of persons
operationId: persons_list
responses:
200:
description: List of persons
schema:
type: object
properties:
meta:
$ref: '#/definitions/Meta'
objects:
type: array
items:
$ref: '#/definitions/Person'
tags:
- persons
- decision_makers
parameters:
- type: integer
in: query
required: false
name: limit
description: Specify the number of element to display per page.
/person/{id}/:
x-swagger-router-controller: persons
get:
summary: Retrieve a single person record
operationId: persons_retrieve
responses:
200:
description: A single person record
schema:
$ref: '#/definitions/Person'
tags:
- persons
- decision_makers
parameters:
- name: id
type: integer
in: path
required: true