-
Notifications
You must be signed in to change notification settings - Fork 25
/
openapi.yaml
723 lines (722 loc) · 22.7 KB
/
openapi.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
openapi: 3.0.0
info:
title: Antragsgrün API
description: Read-Only-API for [Antragsgrün](https://antragsgruen.de/)
version: 0.1.0
paths:
/rest:
get:
summary: List of consultations in this site
responses:
'200':
description: Consultation list
content:
application/json:
schema:
$ref: '#/components/schemas/ConsultationLinkList'
'403':
description: The REST API is not enabled for this consultation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorApiDisabled'
/rest/{consultationPath}:
get:
summary: Overview over this consultation, with links to motions and amendments.
parameters:
- in: path
name: consultationPath
required: true
example: std-parteitag
schema:
type: string
responses:
'200':
description: Consultation info, motion and amendment links
content:
application/json:
schema:
$ref: '#/components/schemas/ConsultationWithLinks'
'403':
description: The REST API is not enabled for this consultation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorApiDisabled'
'404':
description: The consultation was not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorNotFound'
/rest/{consultationPath}/proposed-procedure:
get:
summary: Gets the public proposed procedure of this consultation
parameters:
- in: path
name: consultationPath
required: true
example: std-parteitag
schema:
type: string
responses:
'200':
description: The proposed procedure
content:
application/json:
schema:
$ref: '#/components/schemas/ProposedProcedure'
'403':
description: The REST API is not enabled for this consultation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorApiDisabled'
'404':
description: The consultation was not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorNotFound'
/rest/{consultationPath}/motion/{motionSlug}:
get:
summary: Details of this motion
description: The URL of this endpoint is not 100% predictable (because of motionSlug) - please only use the links provided by the consultation index
parameters:
- in: path
name: consultationPath
required: true
example: std-parteitag
schema:
type: string
- in: path
name: motionSlug
required: true
example: 123-motion
schema:
type: string
- in: query
name: lineNumbers
required: false
example: true
description: If true, then line number markers will be returned in the text (if there are any)
schema:
type: boolean
responses:
'200': # status code
description: Motion info, including links to amendments
content:
application/json:
schema:
$ref: '#/components/schemas/MotionDetails'
'403':
description: The REST API is not enabled for this consultation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorApiDisabled'
'404':
description: The consultation was not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorNotFound'
/rest/{consultationPath}/motion/{motionSlug}/amendment/{amendmentId}:
get:
summary: Details of this amendment
description: The URL of this endpoint is not 100% predictable (because of motionSlug) - please only use the links provided by the consultation index
parameters:
- in: path
name: consultationPath
required: true
example: std-parteitag
schema:
type: string
- in: path
name: motionSlug
required: true
example: 123-motion
schema:
type: string
- in: path
name: amendmentId
required: true
example: 42
schema:
type: string
responses:
'200': # status code
description: Motion info, including links to amendments
content:
application/json:
schema:
$ref: '#/components/schemas/AmendmentDetails'
'403':
description: The REST API is not enabled for this consultation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorApiDisabled'
'404':
description: The consultation was not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorNotFound'
components:
schemas:
ConsultationLinkList:
type: array
items:
type: object
properties:
title:
type: string
example: 44. Bundesdelegiertenkonferenz
title_short:
type: string
example: 44. BDK
date_published:
type: string
example: "2015-03-30T03:27:20+02:00"
url_path:
type: string
example: consultation
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation
url_html:
type: string
example: https://test.antragsgruen.de/consultation
ConsultationWithLinks:
properties:
title:
type: string
example: 44. Bundesdelegiertenkonferenz
title_short:
type: string
example: 44. BDK
motion_links:
type: array
items:
$ref: '#/components/schemas/MotionLinkWithAmendmentLinks'
speaking_lists:
type: array
items:
$ref: '#/components/schemas/SpeakingList'
page_links:
type: array
items:
$ref: '#/components/schemas/PageLinks'
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation
url_html:
type: string
example: https://test.antragsgruen.de/consultation
MotionLinkWithAmendmentLinks:
properties:
type:
type: string
description: Describes if this is a motion or an amendment (e.g., a statute amendment to be shown like a motion)
enum:
- motion
- amendment
id:
type: number
example: 23
agenda_item:
type: string
example: Title of the agenda item
prefix:
type: string
example: A1
title:
type: string
example: Pure title of the motion
title_with_intro:
type: string
example: "Motion A1: Pure title of the motion"
title_with_prefix:
type: string
example: "A1: Pure title of the motion"
status_id:
type: number
example: 3
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Eingereicht
initiators_html:
type: string
example: "Testuser 1"
amendment_links:
type: array
items:
$ref: '#/components/schemas/AmendmentLink'
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion
PageLinks:
properties:
id:
type: number
example: 23
in_menu:
type: boolean
description: Indicates if this page is shown in the main menu
title:
type: string
example: Pure title of the motion
url_json:
type: string
example: https://test.antragsgruen.de/rest/page/testpage
url_html:
type: string
example: https://test.antragsgruen.de/consultation/page/testpage
MotionLink:
properties:
id:
type: number
example: 23
agenda_item:
type: string
example: Title of the agenda item
prefix:
type: string
example: A1
title:
type: string
example: Pure title of the motion
title_with_intro:
type: string
example: "Motion A1: Pure title of the motion"
title_with_prefix:
type: string
example: "A1: Pure title of the motion"
initiators_html:
type: string
example: "Testuser 1"
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion
MotionDetails:
properties:
type:
type: string
example: motion
id:
type: number
example: 23
agenda_item:
type: string
example: Title of the agenda item
prefix:
type: string
example: A1
title:
type: string
example: Pure title of the motion
title_with_intro:
type: string
example: "Motion A1: Pure title of the motion"
title_with_prefix:
type: string
example: "A1: Pure title of the motion"
status_id:
type: number
example: 3
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Eingereicht
date_published:
type: string
example: "2015-03-30T03:27:20+02:00"
supporters:
type: array
items:
$ref: '#/components/schemas/Supporter'
initiators:
type: array
items:
$ref: '#/components/schemas/Supporter'
initiators_html:
type: string
example: "Testuser 1"
sections:
type: array
items:
$ref: '#/components/schemas/MotionSection'
proposed_procedure:
$ref: '#/components/schemas/MotionProposedProcedure'
amendment_links:
type: array
items:
$ref: '#/components/schemas/AmendmentLink'
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion
AmendmentLink:
properties:
id:
type: number
example: 23
prefix:
type: string
example: Ä1
status_id:
type: number
example: 3
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Eingereicht
initiators_html:
type: string
example: "Testuser 1"
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion/amendment/42
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion/42
AmendmentDetails:
properties:
type:
type: string
example: amendment
id:
type: number
example: 23
prefix:
type: string
example: Ä1
title:
type: string
example: "Ä1 zu A1: My motion"
title_with_prefix:
type: string
example: "Ä1 zu A1: My motion"
first_line:
type: number
example: 1
description: The first line affected by this amendment
status_id:
type: number
example: 3
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Eingereicht
date_published:
type: string
example: "2015-03-30T03:27:20+02:00"
motion:
$ref: '#/components/schemas/MotionLink'
supporters:
type: array
items:
$ref: '#/components/schemas/Supporter'
initiators:
type: array
items:
$ref: '#/components/schemas/Supporter'
initiators_html:
type: string
example: "Testuser 1"
sections:
type: array
items:
$ref: '#/components/schemas/AmendmentSection'
proposed_procedure:
$ref: '#/components/schemas/AmendmentProposedProcedure'
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion/amendment/42
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion/42
Supporter:
properties:
type:
type: string
example: person
description: Describes if it is a natural person or an organization
enum:
- person
- organization
name:
type: string
example: Ava
organization:
type: string
example: E Corp
MotionSection:
properties:
type:
type: string
example: TextSimple
enum:
- Title
- TextSimple
- TextHTML
- Image
- TabularData
- PDFAttachment
- PDFAlternative
title:
type: string
example: Motion text
html:
type: string
example: "<strong>This is the motion text</strong>"
layout_right:
type: boolean
example: true
description: In case of a two-column layout, true indicates this section is to be shown on the right
AmendmentSection:
properties:
type:
type: string
example: TextSimple
enum:
- Title
- TextSimple
- TextHTML
- Image
- TabularData
- PDFAttachment
- PDFAlternative
title:
type: string
example: Motion text
html:
type: string
example: "<h3>Antragstext</h3><h4 class=\"lineSummary\">Von Zeile 23 bis 26:</h4><div><p>Dolor lorem. <ins style=\"color:#008000;text-decoration:underline;\">Bavaria</ins> ipsum dolor</p></div>"
AmendmentProposedProcedure:
description: this object is only set if the proposed procedure exists and is public; otherwise the field is "null"
properties:
status_id:
type: number
example: 6
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Modifizierte Übernahme
sections:
type: array
description: The proposed changed version of amendment sections; if there are propsed changes
items:
$ref: '#/components/schemas/AmendmentSection'
MotionProposedProcedure:
description: this object is only set if the proposed procedure exists and is public; otherwise the field is "null"
properties:
status_id:
type: number
example: 6
description: Refer to https://github.com/CatoTH/antragsgruen/blob/main/models/db/IMotion.php#L47 for a definition of the status IDs
status_title:
type: string
example: Modifizierte Übernahme
ProposedProcedure:
description: ...
properties:
proposed_procedure:
type: array
items:
$ref: '#/components/schemas/ProposedProcedureOuterBlock'
ProposedProcedureOuterBlock:
description: An outer proposed procedure block
properties:
title:
type: string
example: "Abstimmung: Wohnen"
voting_blocks:
type: array
items:
$ref: '#/components/schemas/ProposedProcedureVotingBlock'
ProposedProcedureVotingBlock:
description: A voting block
properties:
id:
type: string
example: "19"
description: ID or null
title:
type: string
example: "Abstimmung: Wohnungstausch"
description: title or null
items:
type: array
items:
$ref: '#/components/schemas/ProposedProcedureVotingItem'
ProposedProcedureVotingItem:
description: An individual item (motion or amendment) in a voting block
properties:
type:
type: string
example: "Amendment"
enum:
- Motion
- Amendment
id:
type: number
example: 23
description: the ID of the motion or amendment
prefix:
type: string
example: "W-01-035-3"
title_with_prefix:
type: string
example: "W-01-035-3: Recht auf Wohnen"
url_json:
type: string
example: https://test.antragsgruen.de/rest/consultation/123-motion/amendment/42
url_html:
type: string
example: https://test.antragsgruen.de/consultation/123-motion/42
initiators_html:
type: string
example: "Testuser 1"
procedure:
type: string
example: "<p>Abstimmung (Angenommen)</p><p class=\"explanation\">Das Thema der Abstimmung wird an mehreren Stellen im Antrag beantragt. Die Antragskommission schlägt vor, eine Abstimmung zwischen W-01-034-2 und W-01-035 durchzuführen. Wenn W-01-034-2 angenommen wird, sind W-01-433 und W-01-599 in den Beschlusstext übernommen. Wenn W-01-035 angenommen wird, werden die beiden Anträge W-01-433 und W-01-599 nicht in den Beschlusstext übernommen.</p>"
SpeakingList:
properties:
id:
type: number
example: 23
is_open:
type: boolean
example: true
description: if true, then users can apply for the speaking list
have_applied:
type: boolean
example: true
description: indicates if the current user has already applied for the speaking list.
requires_login:
type: boolean
example: true
description: indicates if users need to be logged in to apply
subqueues:
type: array
items:
$ref: '#/components/schemas/SpeakingListSubqueue'
slots:
type: array
items:
$ref: '#/components/schemas/SpeakingListSlot'
current_time:
type: number
example: 1650106796832
description: unix timestamp in milliseconds of the time the request was served on server side. Can be used to calculate time offset of the browser.
speaking_time:
type: number
example: 300
description: if not null, then this indicates the time in seconds each speaker has
SpeakingListSubqueue:
properties:
id:
type: number
example: 23
description: can be null, if this is a default subqueue
name:
type: string
example: Member group 1
description: can be null, if this is a default subqueue
num_applied:
type: number
example: 4
description: number of users that have already applied for this subqueue
have_applied:
type: boolean
example: true
description: if the currently logged in user has applied for this subqueue
applied:
type: array
items:
$ref: '#/components/schemas/SpeakingListApplicant'
description: list of users that have applied. Only provided if list the list is public.
SpeakingListApplicant:
properties:
id:
type: number
example: 23
description: application id
name:
type: string
example: Johanna Doe
user_id:
type: number
example: 23
description: user id
is_point_of_order:
type: boolean
description: Indicates if this is a point of order. If true, it should be higher prioritized
applied_at:
type: string
example: "2015-03-30T03:27:20+02:00"
SpeakingListSlot:
properties:
id:
type: number
example: 23
description: can be null, if this is a default subqueue
subqueue:
type: object
properties:
id:
type: number
example: 23
description: can be null, if this is a default subqueue
name:
type: string
example: Member group 1
description: can be null, if this is a default subqueue
name:
type: string
example: Johanna Doe
user_id:
type: number
example: 123
position:
type: number
example: 1
date_started:
type: string
example: "2015-03-30T03:27:20+02:00"
description: When the speaking started. null if not yet started.
date_stopped:
type: string
example: "2015-03-30T03:27:20+02:00"
description: When the speaking stopped. null if not yet stopped. If this is null and date_started is set, then the person is currently speaking.
date_applied:
type: string
example: "2015-03-30T03:27:20+02:00"
description: When the speaker applied. Always set.
ErrorNotFound:
properties:
success:
type: boolean
example: false
error:
type: string
example: Object not found
ErrorApiDisabled:
properties:
success:
type: boolean
example: false
error:
type: string
example: API disabled