-
Notifications
You must be signed in to change notification settings - Fork 3
/
a7_openapi.yaml
898 lines (760 loc) · 28.2 KB
/
a7_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
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
openapi: 3.0.0
info:
version: '1.0'
title: 'LBAW UNI-versal Web API'
description: 'Web resources specification (A7) for UNI-versal'
servers:
- url: http://lbaw-prod.fe.up.pt
description: Production server
externalDocs:
description: Find more info here.
url: https://git.fe.up.pt/lbaw/lbaw2122/lbaw2106/-/wikis/home
tags:
- name: 'M01: Authentication and Profile'
- name: 'M02: Questions and Users'
- name: 'M03: Post review'
- name: 'M04: Post management'
- name: 'M05: User management'
- name: 'M06: Static Pages'
paths:
#-------------------- M01 --------------------
# login
/login:
get:
operationId: R101
summary: 'R101: Login Form'
description: 'Provide login form. Access: VIS'
tags:
- 'M01: Authentication and Profile'
responses:
'200':
description: 'Ok. Show login form UI.'
post:
operationId: R102
summary: 'R102: Login Action'
description: 'Login to the website. Access: VIS'
tags:
- 'M01: Authentication and Profile'
requestBody:
required: True
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
password:
type: string
email:
type: string
required:
- inputPassword
- inputEmail
responses:
'302':
description: 'Redirect after login'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Ok. Redirect to Home Page'
value: '/'
302Error:
description: 'Failed Authentication. Redirect to login form.'
value: '/login'
/logout:
post:
operationId: R102
summary: 'R102: Logout Action'
description: 'Logout the current authenticated user. Access: USR'
tags:
- 'M01: Authentication and Profile'
responses:
'302':
description: 'Redirect after processing logout.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful logout. Redirect to homepage.'
value: '/'
/register:
get:
operationId: R104
summary: 'R104: Signup Form'
description: 'Provide signup form. Access: VIS'
tags:
- 'M01: Authentication and Profile'
responses:
'200':
description: 'Ok. Show sign-up form UI.'
post:
operationId: R105
summary: 'R105: Signup Action'
description: 'Signup to the website'
tags:
- 'M01: Authentication and Profile'
requestBody:
required: True
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
password:
type: string
email:
type: string
required:
- name
- password
- email
responses:
'302':
description: 'Redirect after processing signup credentials.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful credential insertion. Redirect to e-mail confirmation notice.'
value: '/email/verify'
302Error:
description: 'Failed credential insertion. Redirect to signup form'
value: '/register'
/email/verify:
get:
operationId: R105
summary: 'R105: Email verification notice'
description: 'Provide email verification notice. Access: USR'
tags:
- 'M01: Authentication and Profile'
responses:
'200':
description: 'Ok. Show email verification notice UI.'
/users/{id}/profile:
get:
operationId: R106
summary: 'R107: View user profile'
description: 'Show the individual user profile. Access: USR'
tags:
- 'M01: Authentication and Profile'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show profile UI.'
post:
operationId: R108
summary: 'R108: Edit Profile Action'
description: 'Processes the new user edition form submission. Access: USR'
tags:
- 'M01: Authentication and Profile'
parameters:
- in: path
name: id
schema:
type: integer
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
picture:
type: string
format: binary
email:
type: string
role:
type: string
faculty:
type: string
area:
type: string
responses:
'302':
description: 'Redirect after processing the user new information.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful profile edition. Redirect to user profile.'
value: '/users/{id}/profile'
302Failure:
description: 'Failed to edit. Redirect to user profile.'
value: '/users/{id}/profile'
/users/{id}/profile/edit:
get:
operationId: R107
summary: 'R107: View user profile edit form'
description: 'Show the individual user profile edition form. Access: USR'
tags:
- 'M01: Authentication and Profile'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show profile edition form UI.'
/user/{id}/notifications:
get:
operationId: R108
summary: 'R108: View notifications'
description: "Show the user's notifications. Access: USR"
tags:
- 'M01: Authentication and Profile'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show notifications.'
# -------------------- M02 --------------------
/topics/{topic_name}:
get:
operationId: R201
summary: 'R201: Get Topic Page'
description: 'Show the page where questions of a certain topic are listed. Access: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show Topic UI'
/search:
get:
operationId: R202
summary: 'R202: Get Search Question Results'
description: 'Load the questions most relevant for a given search. Access: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: query
name: query
description: 'String to use for full-text search'
schema:
type: string
required: true
responses:
'302':
description: 'Redirect after processing the information.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Redirect to search questions.'
value: '/search/questions'
/search/{search-input}/questions/:
get:
operationId: R203
summary: 'R202: Get Search Question Results'
description: 'Load the questions most relevant for a given search. Access: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: query
name: query
description: 'String to use for full-text search'
schema:
type: string
required: true
responses:
'200':
description: 'Ok. Show questions search results UI'
/search/{search-input}/users/:
get:
operationId: R204
summary: 'R202: Get Search Question Results'
description: 'Load the users most relevant for a given search. Access: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: query
name: query
description: 'String to use for full-text search'
schema:
type: string
required: true
responses:
'200':
description: 'Ok. Show user search results UI'
/search/{search-input}/users/filtered:
get:
operationId: R205
summary: 'R205: Filter User Results'
description: 'Filter the users by a given parameter. Acess: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: query
name: filteringParameter
schema:
type: string
required: true
responses:
'200':
description: 'Ok. Show user search results UI with filtered users'
/search/{search-input}/questions/filtered:
get:
operationId: R205
summary: 'R205: Filter User Results'
description: 'Filter and sort the questions by different parameters. Acess: USR'
tags:
- 'M02: Questions and Users'
parameters:
- in: query
name: filteringParameter
schema:
type: string
required: true
- in: query
name: sortingParameter
schema:
type: string
required: true
- in: query
name: topic
schema:
type: string
required: true
responses:
'200':
description: 'Ok. Show user search results UI with filtered questions'
#-------------------- M03 --------------------
/question/{id}/upvote:
post:
operationId: R301
summary: 'R301: Upvote post'
description: 'Authenticated user upvotes the current post rating'
tags:
- 'M03: Post review'
parameters:
- in: path
name: id
schema:
type: integer
required: true
- in: path
name: post_id
schema:
type: integer
required: true
responses:
'200':
description: 'Upvote action was successful.'
/question/{id}/bookmark:
post:
operationId: R302
summary: 'R303: Bookmark post'
description: 'Authenticated user bookmarks the current post'
tags:
- 'M03: Post review'
parameters:
- in: path
name: id
schema:
type: integer
required: true
- in: query
name: id_USRer
schema:
type: integer
required: true
responses:
'200':
description: 'Bookmarking was successful.'
#-------------------- M04 --------------------#
/questions/create:
get:
operationId: R401
summary: 'R401: Create question'
description: 'Show the question creation form page. Access: USR'
tags:
- 'M04: Post management'
responses:
'200':
description: 'Ok. Show question form'
post:
operationId: R402
summary: 'R402: Question creating action'
description: 'Processes the creation of a new question. Access: USR'
tags:
- 'M04: Post management'
requestBody:
required: True
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
author:
type: string
tag:
type: string
title:
type: string
body:
type: string
topic:
type: string
files:
type: array
items:
type: integer
format: binary
images:
type: array
items:
type: integer
format: binary
required:
- title
- body
- topic
responses:
'302':
description: 'Redirect after processing the new question information'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Sucessfull question creation. Redirected to the question page.'
value: '/question/{id}'
302Error:
description: 'Failed question creation. Redirected to the question creation form page.'
value: '/questions/create'
/question/{id}:
get:
operationId: R403
summary: 'R403: View question'
description: 'Show the question. Access: USR'
tags:
- 'M04: Post management'
responses:
'200':
description: 'Ok. Show question'
/question/{id}/answer:
post:
operationId: R404
summary: 'R404: Answer to a question'
description: 'Processes the creation of a new answer. Access: USR'
tags:
- 'M04: Post management'
requestBody:
required: True
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
author:
type: string
body:
type: string
files:
type: string
format: binary
required:
- body
- author
responses:
'302':
description: 'Redirect after publishing the new answer'
headers:
Location:
schema:
type: string
examples:
301Success:
description: 'Sucessfull answer creation. Redirected to the specific question page.'
value: '/question/{id}'
301Error:
description: 'Failed answer creation. Redirected to the specific question page.'
value: '/question/{id}'
/post/{id}/delete:
delete:
operationId: R405
summary: 'R405: Answer deletion action'
description: 'Processes the deletion of a answer. Access: OWN'
tags:
- 'M04: Post management'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'302':
description: 'Redirect after deleting the answer'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Sucessfull deletion. Redirected to the specific question page.'
value: 'question/{id}'
302Error:
description: 'Failed deletion. Redirected to the specific answer page.'
value: 'question/{id}'
/user/{id}/drafts:
get:
operationId: R407
summary: 'R407: View drafts'
description: 'Show drafts page. Access: OWN'
tags:
- 'M04: Post management'
responses:
'200':
description: 'Ok. Show drafts'
/user/{id}/drafts/{id_draft}:
delete:
operationId: R408
summary: 'R408: Draft deleting action'
description: 'Processes the deletion of a draft. Access: OWN'
tags:
- 'M04: Post management'
parameters:
- in: path
name: id
schema:
type: integer
required: true
- in: path
name: id_draft
schema:
type: integer
required: true
responses:
'302':
description: 'Redirect after deleting the draft'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Sucessfull deletion. Redirected to the specific topic page.'
value: '/user/{id}/drafts'
302Error:
description: 'Failed deletion. Redirected to the specific topic page.'
value: '/user/{id}/drafts'
get:
operationId: R409
summary: 'R409: Import chosen draft'
description: 'Import the data from the selected draft. Access: OWN'
tags:
- 'M04: Post management'
parameters:
- in: path
name: id
schema:
type: integer
required: true
- in: path
name: id_draft
schema:
type: integer
required: true
responses:
'200':
description: 'Redirect after choosing the draft'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Sucessfull loading draft. Redirected to the question creation page.'
value: '/questions/create'
302Error:
description: 'Failed to load draft. Redirected to the drafts page.'
value: '/user/{id}/drafts'
#-------------------- M05 --------------------
/moderator/{id}:
get:
operationId: R501
summary: 'R501: Moderator View'
description: 'Show the moderator page. Access: MOD'
tags:
- 'M05: User management'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'200':
description: 'Ok. Show moderator page.'
/user/{id}/ban:
delete:
operationId: R502
summary: 'R502: Ban USRer'
description: 'Processes the USRer banning request. Access: MOD'
tags:
- 'M05: User management'
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
'302':
description: 'Redirect after USRer banning.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful banning. Redirect to home page.'
value: '/'
302Failure:
description: "Failed to ban. Redirect to USRer's profile page."
value: 'user/{id}/profile'
/systemNotifications:
get:
operationId: R503
summary: 'R504: Access system notification page'
description: 'Accesses the system notification page. Access: ADM'
tags:
- 'M05: User management'
responses:
'200':
description: 'Ok. Show moderator page.'
post:
operationId: R504
summary: 'R504: Generate system notification'
description: 'Processes the system notification request. Access: ADM'
tags:
- 'M05: User management'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
title:
type: string
body:
type: string
required:
- title
- body
responses:
'302':
description: 'Redirect after processing system notification creation request.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful system notification creation. Redirect to home page.'
value: '/'
302Error:
description: 'Failed credential insertion. Redirect to home page'
value: '/systemNotifications'
/user/{id}/promote:
post:
operationId: R505
summary: 'R505: Promote USRer to moderator'
description: 'Processes the promotion of a USRer to moderator. Access: MOD'
tags:
- 'M05: User management'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
USRerName:
type: string
yourPassword:
type: string
required:
- USRerName
- yourPassword
- repeatYourPassword
responses:
'302':
description: 'Redirect after processing system notification creation request.'
headers:
Location:
schema:
type: string
examples:
302Success:
description: 'Successful promotion. Redirect to profile page.'
value: '/user/{id}'
302Error:
description: 'Failed promotion. Redirect to profile page'
value: '/user/{id}'
# -------------------- M06 --------------------
/about:
get:
operationId: R601
summary: 'R601: About/Faq'
description: 'Show the about/faq page. Access: VIS'
tags:
- 'M06: Static Pages'
responses:
'200':
description: 'Ok. Show About/Faq UI'
/:
get:
operationId: R602
summary: 'R602: Home'
description: 'Show the home page. Access: VIS'
tags:
- 'M06: Static Pages'
responses:
'200':
description: 'Ok. Show Home Page UI'
/contact:
get:
operationId: R603
summary: 'R603: Contact'
description: 'Show contact page. Access: VIS'
tags:
- 'M06: Static Pages'
responses:
'200':
description: 'Ok. Show Home Page UI'