-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.json
578 lines (578 loc) · 17.5 KB
/
swagger.json
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
{
"swagger": "2.0",
"info": {
"title": "Kursutveckling API",
"description": "Used to collect and show course analysis with some course data",
"version": "1.0.0"
},
"basePath": "/api/kursutveckling",
"produces": ["application/json"],
"paths": {
"/_checkAPIkey": {
"get": {
"operationId": "checkAPIkey",
"summary": "Test authentication setup",
"description": "Secured test endpoint which can be used to validate that a client has a working authentication setup\n\n_(System.checkAPIKey)_",
"parameters": [],
"responses": {
"200": {
"description": "The given authentication is **accepted**"
},
"401": {
"description": "This endpoint is secured - **credentials are missing or invalid**."
},
"default": {
"description": "Unexpected response - internal error"
}
},
"security": [{ "api_key": ["read"] }]
}
},
"/v1/courseRoundAnalysis/{id}": {
"get": {
"operationId": "getCourseRoundAnalysisDataById",
"summary": "Get a list of all analysis connected to a course code",
"description": "Get a list of all analysis connected to a course code",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Course Round Analysis Id (Course Code + Semester + _ + Round Id(s)",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "List of analyses for course code and all the data",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
},
"post": {
"operationId": "postCourseRoundAnalysisDataById",
"summary": "Saves an analysis object in the database",
"description": "Saves an analysis object in the database",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Course Round Analysis Id (Course Code + Semester + _ + Round Id(s)",
"required": true,
"type": "string"
},
{
"name": "roundAnalysisData",
"in": "body",
"description": "Analysis data ",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "A successful save"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["write"]
}
]
},
"put": {
"operationId": "putCourseRoundAnalysisDataById",
"summary": "Updates an analysis",
"description": "Saves changes to an analysis in the database",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Course Round Analysis Id (Course Code + Semester + _ + Round Id(s)",
"required": true,
"type": "string"
},
{
"name": "roundAnalysisData",
"in": "body",
"description": "Analysis data for a course round(s) round ",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "A successful update"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["write"]
}
]
},
"delete": {
"operationId": "deleteCourseRoundAnalysisDataById",
"summary": "Delete an analysis",
"description": "Delete all information for analysis with sent id",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the round.semester.year.x to delete analysis data",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "The analysis was deleted",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
}
},
"/v1/usedRoundsForCourse/{courseCode}/semester/{semester}": {
"get": {
"operationId": "getUsedRounds",
"summary": "Gets a list of used round ids for a semester in a course",
"parameters": [
{
"name": "courseCode",
"in": "path",
"description": "Course code, six or seven characters",
"required": true,
"type": "string"
},
{
"name": "semester",
"description": "Semester for rounds",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "Round ids",
"schema": {
"$ref": "#/definitions/UsedRoundsForCourseAndSemester"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
}
},
"/v1/courseAnalysisList/{courseCode}/{semester}": {
"get": {
"operationId": "getAnalysisListByCourseCode",
"summary": "Get a list of analyses for a course",
"description": "Gets analyses for rounds in a course",
"parameters": [
{
"name": "courseCode",
"in": "path",
"description": "Id of the course code",
"required": true,
"type": "string"
},
{
"name": "semester",
"in": "path",
"description": "Semester code, five numbers as a string (year + 1 (spring) or 2 (fall). Filter results for that semester",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "Successfully got analyses for requested course code and semester",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
}
},
"/v1/courseAnalyses/{semester}": {
"get": {
"operationId": "getCourseAnalysesForSemester",
"summary": "Get a list of published analyses for a semester",
"description": "Gets all published analyses for rounds in a semester",
"parameters": [
{
"name": "semester",
"in": "path",
"description": "Semester code, five numbers as a string (year + 1 (spring) or 2 (fall). Filter results for that semester",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "Successfully got published analyses for requested semester",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
}
},
"/v1/courseAnalysesForSemestersList": {
"get": {
"operationId": "getCourseAnalysesForSemestersList",
"summary": "Get a list of published analyses for a list of semesters",
"description": "Gets all published analyses for rounds for all semesters provided in query ?semesters=20212,29222",
"parameters": [
{
"name": "semester",
"in": "query",
"description": "Semesters codes, each semester code is five numbers as a string (year + 1 (spring) or 2 (fall). Filter results for these semesters",
"required": true,
"type": "string"
}
],
"tags": ["v1"],
"responses": {
"200": {
"description": "Successfully got published analyses for requested semesters",
"schema": {
"$ref": "#/definitions/RoundAnalysis"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"security": [
{
"api_key": ["read"]
}
]
}
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header",
"scopes": {
"read": "Read access to data",
"write": "Write access to data"
}
}
},
"definitions": {
"RoundAnalysis": {
"type": "object",
"required": ["courseCode"],
"properties": {
"analysisName": {
"type": "string",
"description": "Analysis name"
},
"courseCode": {
"type": "string",
"description": "Coure code for the course that are connected to the analysis"
},
"programmeCodes": {
"type": "string",
"description": "Programmes that are mandatory"
},
"examiners": {
"type": "string",
"description": "Examiner(s) for the course that semester"
},
"responsibles": {
"type": "string",
"description": "Responsible(s) for the course that semester"
},
"examinationRounds": {
"type": "string",
"description": "Examinations rounds for the course and semester"
},
"registeredStudents": {
"type": "string",
"description": "Number of registere student for round(s) that semester"
},
"examinationGrade": {
"type": "string",
"description": "Precentage of students completed the round(s)"
},
"endDate": {
"type": "string",
"description": "End date for round(s) that semester"
},
"alterationText": {
"type": "string",
"description": "Text that descibes changes that have been made in the course"
},
"commentExam": {
"type": "string",
"description": "Comment to Examination round(s)"
},
"commentChange": {
"type": "string",
"description": "Mandatory text if changes are made after analysis been published"
},
"isPublished": {
"type": "string",
"description": "Sets to true when analysis is published"
},
"publishedDate": {
"type": "string",
"description": "Date when analysis is first published"
},
"pdfAnalysisDate": {
"type": "string",
"description": "Date when analysis file was uploaded"
},
"changedDate": {
"type": "string",
"description": "Date when an analysis was updated"
},
"changedBy": {
"type": "string",
"description": "Username of creator of the analysis"
},
"semester": {
"type": "string",
"description": "Course semester for analysis"
},
"applicationCodes": {
"type": "string",
"description": "Application code(s) used in analysis"
},
"analysisFileName": {
"type": "string",
"description": "Name of uploaded analysis file"
},
"ugKeys": {
"type": "array",
"items": { "type": "string" },
"description": "UG Keys for user access to edit analysis"
},
"syllabusStartTerm": {
"type": "string",
"description": "Connected syllabus"
},
"changedAfterPublishedDate": {
"type": "string",
"description": "Date for changes made after published"
},
"examinationGradeFromLadok": {
"type": "boolean",
"description": "A check if values been collected from Ladok or filled in by user"
},
"registeredStudentsFromLadok": {
"type": "boolean",
"description": "A check if values been collected from Ladok or filled in by user"
},
"registeredStudentsLadok": {
"type": "integer",
"description": "The result of registered students that was collected from Ladok "
},
"examinationGradeLadok": {
"type": "integer",
"description": "The result of examination grade that was collected from Ladok "
},
"endDateFromLadok": {
"type": "boolean",
"description": "A check if values been collected from Ladok or filled in by user"
},
"endDateLadok": {
"type": "string",
"description": "The end date used for result of examination grade that was collected from Ladok "
},
"ladokUIDs": {
"type": "array",
"description": "The UIDs collected from Ladok",
"items": { "type": "string" }
}
},
"example": {
"_id": "XYZ123VT2021_1",
"alterationText": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras cursus vel urna vel scelerisque. Integer erat risus, rutrum vitae vestibulum et, condimentum vitae nisl.",
"analysisFileName": "analysis-XYZ123VT2021-1-20210601-00-01.pdf",
"analysisName": "XYZ ( Startdatum 2021-02-01, Svenska ) ",
"changedAfterPublishedDate": "",
"changedBy": "xyz",
"changedDate": "2021-06-01T00:01:01.001Z",
"commentChange": "",
"commentExam": "<p>Duis neque neque, vestibulum a erat non, viverra posuere dui. Maecenas quis nunc non turpis luctus fringilla. Integer dui est, sodales sit amet dapibus dictum, luctus non purus. Etiam vestibulum tincidunt nulla et blandit.<br />In pellentesque velit at finibus vulputate. Quisque feugiat interdum nulla.</p>",
"courseCode": "XYZ123",
"endDate": "2021-05-01",
"endDateFromLadok": true,
"endDateLadok": "2021-05-01",
"examinationGrade": "99.0",
"examinationGradeFromLadok": true,
"examinationGradeLadok": 99,
"examinationRounds": "",
"examiners": "xyz",
"isPublished": "true",
"ladokUIDs": ["aa485652-148f-11ec-82a8-0242ac130003"],
"programmeCodes": "XYZ",
"pdfAnalysisDate": "2021-06-01",
"publishedDate": "2021-06-01T01:01:01.001Z",
"responsibles": "xyz",
"registeredStudents": "xyz",
"registeredStudentsFromLadok": true,
"registeredStudentsLadok": 100,
"applicationCodes": "1",
"semester": "20211",
"syllabusStartTerm": "20211",
"ugKeys": ["XYZ123.examiner", "XYZ123.20211.1.courseresponsible"]
}
},
"UsedRoundsForCourseAndSemester": {
"properties": {
"usedRounds": {
"type": "array",
"items": { "type": "string" },
"description": "List of round ids that have been used for a course semester"
},
"publishedAnalysis": {
"type": "array",
"items": {
"type": "object",
"properties": {
"schema": {
"$ref": "#/definitions/UsedAnalysis"
}
}
},
"description": "List of published analysis, name, id, UGkeys"
},
"draftAnalysis": {
"type": "array",
"items": {
"type": "object",
"properties": {
"schema": {
"$ref": "#/definitions/UsedAnalysis"
}
}
},
"description": "List of draft analysis, name, id, UGkeys"
}
}
},
"UsedAnalysis": {
"properties": {
"user": {
"type": "string"
},
"isPublished": {
"type": "boolean"
},
"analysisId": {
"type": "string"
},
"analysisName": {
"type": "string"
},
"ugKeys": {
"type": "array",
"items": { "type": "string" }
}
}
},
"Error": {
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
}