Skip to content

Commit 160451b

Browse files
committed
Fixing swagger generator (problem with quotes in annotations).
1 parent 8e01059 commit 160451b

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

app/helpers/Swagger/AnnotationData.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public function __construct(
6565
$this->responseDataList = $responseDataList;
6666
$this->endpointDescription = $endpointDescription;
6767
$this->deprecated = $deprecated;
68+
69+
if ($this->endpointDescription) {
70+
$this->endpointDescription = str_replace('"', "'", $this->endpointDescription);
71+
}
72+
if ($this->deprecated) {
73+
$this->deprecated = str_replace('"', "'", $this->deprecated);
74+
}
6875
}
6976

7077
private function getSummary(): ?string

docs/swagger.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,6 +2850,49 @@ paths:
28502850
code: { description: 'HTTP response code.', type: integer, example: '0', nullable: false }
28512851
payload: { description: 'The payload of the response.', properties: { id: { description: 'An identifier of the group', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, externalId: { description: 'An informative, human readable identifier of the group', type: string, example: text, nullable: true }, organizational: { description: 'Whether the group is organizational (no assignments nor students).', type: boolean, example: 'true', nullable: false }, exam: { description: 'Whether the group is an exam group.', type: boolean, example: 'true', nullable: false }, archived: { description: 'Whether the group is archived', type: boolean, example: 'true', nullable: false }, public: { description: 'Should the group be visible to all student?', type: boolean, example: 'true', nullable: false }, directlyArchived: { description: 'Whether the group was explicitly marked as archived', type: boolean, example: 'true', nullable: false }, localizedTexts: { description: 'Localized names and descriptions', type: array, items: { }, nullable: false }, primaryAdminsIds: { description: 'IDs of users which are explicitly listed as direct admins of this group', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, parentGroupId: { description: 'Identifier of the parent group (absent for a top-level group)', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, parentGroupsIds: { description: 'Identifications of groups in descending order.', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, childGroups: { description: 'Identifications of child groups.', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, privateData: { description: '', properties: { admins: { description: 'IDs of all users that have admin privileges to this group (including inherited)', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, supervisors: { description: 'IDs of all group supervisors', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, observers: { description: 'IDs of all group observers', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, students: { description: 'IDs of the students of this group', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, instanceId: { description: 'ID of an instance in which the group belongs', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, hasValidLicence: { description: 'Whether the instance where the group belongs has a valid license', type: boolean, example: 'true', nullable: false }, assignments: { description: 'IDs of all group assignments', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, shadowAssignments: { description: 'IDs of all group shadow assignments', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, publicStats: { description: "Whether the student's results are visible to other students", type: boolean, example: 'true', nullable: false }, detaining: { description: 'Whether the group detains the students (so they can be released only by the teacher)', type: boolean, example: 'true', nullable: false }, threshold: { description: 'A relative number of points a student must receive from assignments to fulfill the requirements of the group', type: number, example: '0.1', nullable: false }, pointsLimit: { description: "A minimal number of points that a student must receive to fulfill the group's requirements", type: integer, example: '0', nullable: false }, bindings: { description: 'Entities bound to the group', type: array, items: { }, nullable: false }, examBegin: { description: 'The time when the exam starts if there is an exam scheduled', type: integer, example: '1740135333', nullable: false }, examEnd: { description: 'The time when the exam ends if there is an exam scheduled', type: integer, example: '1740135333', nullable: false }, examLockStrict: { description: 'Whether the scheduled exam requires a strict access lock', type: boolean, example: 'true', nullable: false }, exams: { description: 'All past exams (with at least one student locked)', type: array, items: { }, nullable: false } }, type: object, nullable: false }, permissionHints: { description: '', type: array, items: { }, nullable: false } }, type: object, nullable: false }
28522852
type: object
2853+
'/v1/groups/{id}/exam':
2854+
post:
2855+
summary: "Change the group 'exam' indicator. If denotes that the group should be listed in exam groups instead of regular groups and the assignments should have 'isExam' flag set by default."
2856+
description: "Change the group 'exam' indicator. If denotes that the group should be listed in exam groups instead of regular groups and the assignments should have 'isExam' flag set by default."
2857+
operationId: groupsPresenterActionSetExam
2858+
parameters:
2859+
-
2860+
name: id
2861+
in: path
2862+
description: 'An identifier of the updated group'
2863+
required: true
2864+
schema:
2865+
type: string
2866+
pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
2867+
nullable: false
2868+
requestBody:
2869+
content:
2870+
application/json:
2871+
schema:
2872+
required:
2873+
- value
2874+
properties:
2875+
value:
2876+
description: 'The value of the flag'
2877+
type: boolean
2878+
example: 'true'
2879+
nullable: false
2880+
type: object
2881+
responses:
2882+
'200':
2883+
description: 'Response data'
2884+
content:
2885+
application/json:
2886+
schema:
2887+
required:
2888+
- success
2889+
- code
2890+
- payload
2891+
properties:
2892+
success: { description: 'Whether the request was processed successfully.', type: boolean, example: 'true', nullable: false }
2893+
code: { description: 'HTTP response code.', type: integer, example: '0', nullable: false }
2894+
payload: { description: 'The payload of the response.', properties: { id: { description: 'An identifier of the group', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, externalId: { description: 'An informative, human readable identifier of the group', type: string, example: text, nullable: true }, organizational: { description: 'Whether the group is organizational (no assignments nor students).', type: boolean, example: 'true', nullable: false }, exam: { description: 'Whether the group is an exam group.', type: boolean, example: 'true', nullable: false }, archived: { description: 'Whether the group is archived', type: boolean, example: 'true', nullable: false }, public: { description: 'Should the group be visible to all student?', type: boolean, example: 'true', nullable: false }, directlyArchived: { description: 'Whether the group was explicitly marked as archived', type: boolean, example: 'true', nullable: false }, localizedTexts: { description: 'Localized names and descriptions', type: array, items: { }, nullable: false }, primaryAdminsIds: { description: 'IDs of users which are explicitly listed as direct admins of this group', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, parentGroupId: { description: 'Identifier of the parent group (absent for a top-level group)', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, parentGroupsIds: { description: 'Identifications of groups in descending order.', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, childGroups: { description: 'Identifications of child groups.', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, privateData: { description: '', properties: { admins: { description: 'IDs of all users that have admin privileges to this group (including inherited)', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, supervisors: { description: 'IDs of all group supervisors', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, observers: { description: 'IDs of all group observers', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, students: { description: 'IDs of the students of this group', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, instanceId: { description: 'ID of an instance in which the group belongs', type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000, nullable: false }, hasValidLicence: { description: 'Whether the instance where the group belongs has a valid license', type: boolean, example: 'true', nullable: false }, assignments: { description: 'IDs of all group assignments', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, shadowAssignments: { description: 'IDs of all group shadow assignments', type: array, items: { type: string, pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', example: 10000000-2000-4000-8000-160000000000 }, nullable: false }, publicStats: { description: "Whether the student's results are visible to other students", type: boolean, example: 'true', nullable: false }, detaining: { description: 'Whether the group detains the students (so they can be released only by the teacher)', type: boolean, example: 'true', nullable: false }, threshold: { description: 'A relative number of points a student must receive from assignments to fulfill the requirements of the group', type: number, example: '0.1', nullable: false }, pointsLimit: { description: "A minimal number of points that a student must receive to fulfill the group's requirements", type: integer, example: '0', nullable: false }, bindings: { description: 'Entities bound to the group', type: array, items: { }, nullable: false }, examBegin: { description: 'The time when the exam starts if there is an exam scheduled', type: integer, example: '1740135333', nullable: false }, examEnd: { description: 'The time when the exam ends if there is an exam scheduled', type: integer, example: '1740135333', nullable: false }, examLockStrict: { description: 'Whether the scheduled exam requires a strict access lock', type: boolean, example: 'true', nullable: false }, exams: { description: 'All past exams (with at least one student locked)', type: array, items: { }, nullable: false } }, type: object, nullable: false }, permissionHints: { description: '', type: array, items: { }, nullable: false } }, type: object, nullable: false }
2895+
type: object
28532896
'/v1/groups/{id}/examPeriod':
28542897
post:
28552898
summary: 'Set an examination period (in the future) when the group will be secured for submitting. Only locked students may submit solutions in the group during this period. This endpoint is also used to update already planned exam period, but only dates in the future can be edited (e.g., once an exam begins, the beginning may no longer be updated).'
@@ -5745,6 +5788,37 @@ paths:
57455788
responses:
57465789
'200':
57475790
description: 'Placeholder response'
5791+
'/v1/users/{id}/allowed':
5792+
post:
5793+
summary: "Set 'isAllowed' flag of the given user. The flag determines whether a user may perform any operation of the API."
5794+
description: "Set 'isAllowed' flag of the given user. The flag determines whether a user may perform any operation of the API."
5795+
operationId: usersPresenterActionSetAllowed
5796+
parameters:
5797+
-
5798+
name: id
5799+
in: path
5800+
description: 'Identifier of the user'
5801+
required: true
5802+
schema:
5803+
type: string
5804+
pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
5805+
nullable: false
5806+
requestBody:
5807+
content:
5808+
application/json:
5809+
schema:
5810+
required:
5811+
- isAllowed
5812+
properties:
5813+
isAllowed:
5814+
description: 'Whether the user is allowed (active) or not.'
5815+
type: boolean
5816+
example: 'true'
5817+
nullable: false
5818+
type: object
5819+
responses:
5820+
'200':
5821+
description: 'Placeholder response'
57485822
'/v1/users/{id}/external-login/{service}':
57495823
post:
57505824
summary: 'Add or update existing external ID of given authentication service.'

0 commit comments

Comments
 (0)