Skip to content

Commit 6ce15e9

Browse files
committed
chore: Add PR's requested changes
1 parent 5cc0f3a commit 6ce15e9

File tree

7 files changed

+190
-83
lines changed

7 files changed

+190
-83
lines changed

app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTrackChairsApiController.php

Lines changed: 94 additions & 53 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
9+
#[OA\Schema(
10+
schema: 'AdminMember',
11+
allOf: [
12+
new OA\Schema(ref: '#/components/schemas/Member'),
13+
new OA\Schema(
14+
type: 'object',
15+
properties: [
16+
new OA\Property(property: 'email', type: 'string', format: 'email'),
17+
new OA\Property(property: 'second_email', type: 'string', format: 'email'),
18+
new OA\Property(property: 'third_email', type: 'string', format: 'email'),
19+
new OA\Property(property: 'user_external_id', type: 'integer'),
20+
new OA\Property(property: 'rsvp', type: 'array', items: new OA\Items(type: 'integer'), description: 'Array of RSVP IDs, full objects available when expand=rsvp'),
21+
new OA\Property(property: 'rsvp_invitations', type: 'array', items: new OA\Items(type: 'integer'), description: 'Array of RSVP Invitation IDs, full objects available when expand=rsvp_invitations'),
22+
]
23+
)
24+
]
25+
)]
26+
class AdminMemberSchema {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'SummitAbstractLocation',
10+
type: 'object',
11+
properties: [
12+
new OA\Property(property: 'id', type: 'integer', example: 1),
13+
new OA\Property(property: 'created', type: 'integer', example: 1),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1),
15+
new OA\Property(property: 'name', type: 'string'),
16+
new OA\Property(property: 'short_name', type: 'string'),
17+
new OA\Property(property: 'description', type: 'string'),
18+
new OA\Property(property: 'location_type', type: 'string'),
19+
new OA\Property(property: 'order', type: 'integer'),
20+
new OA\Property(property: 'opening_hour', type: 'integer'),
21+
new OA\Property(property: 'closing_hour', type: 'integer'),
22+
new OA\Property(property: 'class_name', type: 'string'),
23+
new OA\Property(property: 'published_events', type: 'array', items: new OA\Items(type: 'integer'), description: 'Array of published event IDs'),
24+
]
25+
)]
26+
class SummitAbstractLocationSchema
27+
{
28+
}

app/Swagger/Security/SummitTrackChairSchemas.php renamed to app/Swagger/Security/TrackChairsAuthSchema.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<?php
2-
namespace App\Swagger\schemas;
1+
<?php
32

3+
namespace App\Swagger\schemas;
44

55
use App\Security\SummitScopes;
66
use OpenApi\Attributes as OA;
77

8-
#[
9-
OA\SecurityScheme(
8+
#[OA\SecurityScheme(
109
type: 'oauth2',
1110
securityScheme: 'summit_track_chairs_oauth2',
1211
flows: [
@@ -23,4 +22,4 @@
2322
],
2423
)
2524
]
26-
class TrackChairsAuthSchema{}
25+
class TrackChairsAuthSchema{}

app/Swagger/SummitProposedScheduleSchemas.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
new OA\Property(property: "id", type: "integer", example: 1),
1111
new OA\Property(property: "created", type: "integer", description: "Unix timestamp", example: 1640995200),
1212
new OA\Property(property: "last_edited", type: "integer", description: "Unix timestamp", example: 1640995200),
13-
new OA\Property(property: "allowed_timeframes", type: "array", items: new OA\Items(type: "integer"), description: "Array SummitProposedScheduleAllowedDay IDs or full SummitProposedScheduleAllowedDay objects when expanded", nullable: true),
13+
new OA\Property(property: "allowed_timeframes", type: "array", items: new OA\Items(oneOf: [
14+
new OA\Schema(type: 'integer'),
15+
new OA\Schema(ref: '#/components/schemas/SummitProposedScheduleAllowedDay')
16+
]), description: "Array of allowed timeframe IDs or objects when expand=allowed_timeframes",),
1417
new OA\Property(property: "location_id", type: "integer", example: 10, description: "only when not expanded"),
15-
new OA\Property(property: "location", type: "integer", description: "ID of the SummitAbstractLocation, when not expanded, when ?expand=location, you get a SummitAbstractLocation schema object in a 'location' property"),
16-
new OA\Property(property: "track_id", type: "integer", example: 5, description: "only when not expanded"),
17-
new OA\Property(property: "track", type: "integer", description: "ID of the PresentationCategory, when not expanded, when ?expand=track, you get a PresentationCategory schema object in a 'track' property"),
18+
new OA\Property(property: "location", ref: '#/components/schemas/SummitAbstractLocation', description: "only when expand=location"),
19+
new OA\Property(property: "track_id", type: "integer", example: 5, description: "PresentationCategory ID, use expand=track for full object details"),
1820
],
1921
)]
20-
class SummitProposedScheduleAllowedLocation {}
22+
class SummitProposedScheduleAllowedLocationSchema {}
2123

2224
#[OA\Schema(
2325
schema: "SummitProposedScheduleAllowedLocationRequest",
@@ -26,7 +28,7 @@ class SummitProposedScheduleAllowedLocation {}
2628
new OA\Property(property: "location_id", type: "integer", example: 10)
2729
]
2830
)]
29-
class SummitProposedScheduleAllowedLocationRequest {}
31+
class SummitProposedScheduleAllowedLocationRequestSchema {}
3032

3133
#[OA\Schema(
3234
schema: "SummitProposedScheduleAllowedDay",
@@ -40,7 +42,7 @@ class SummitProposedScheduleAllowedLocationRequest {}
4042
new OA\Property(property: "closing_hour", type: "integer", description: "Closing hour in HHMM format (0-2359)", example: 1700)
4143
]
4244
)]
43-
class SummitProposedScheduleAllowedDay {}
45+
class SummitProposedScheduleAllowedDaySchema {}
4446

4547
#[OA\Schema(
4648
schema: "SummitProposedScheduleAllowedDayAddRequest",
@@ -51,7 +53,7 @@ class SummitProposedScheduleAllowedDay {}
5153
new OA\Property(property: "closing_hour", type: "integer", description: "Closing hour in HHMM format (0-2359)", example: 1700)
5254
]
5355
)]
54-
class SummitProposedScheduleAllowedDayAddRequest {}
56+
class SummitProposedScheduleAllowedDayAddRequestSchema {}
5557

5658
#[OA\Schema(
5759
schema: "SummitProposedScheduleAllowedDayUpdateRequest",
@@ -61,7 +63,7 @@ class SummitProposedScheduleAllowedDayAddRequest {}
6163
new OA\Property(property: "closing_hour", type: "integer", description: "Closing hour in HHMM format (0-2359)", example: 1700)
6264
]
6365
)]
64-
class SummitProposedScheduleAllowedDayUpdateRequest {}
66+
class SummitProposedScheduleAllowedDayUpdateRequestSchema {}
6567
#[OA\Schema(
6668
schema: "SummitProposedScheduleSummitEvent",
6769
properties: [

app/Swagger/SummitTrackChairSchemas.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@
1414
new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp'),
1515
new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp'),
1616
new OA\Property(
17-
property: 'categories',
18-
type: 'array',
19-
items: new OA\Items(type: ['integer', 'PresentationCategory']),
20-
description: 'Array of category IDs by default. Use expand=categories to get full objects. Use relations=categories to include'
17+
property: 'categories',
18+
type: 'array',
19+
items: new OA\Items(type: 'integer'),
20+
description: "Array of PresentationCategory ID, Use expand=categories to get full objects"
2121
),
22-
],
23-
anyOf: [
2422
new OA\Property(property: 'summit_id', type: 'integer', example: 10, description: 'Summit ID when not expanded'),
25-
new OA\Property(property: 'summit', type: 'Summit', description: 'Full Summit object when expanded (expand=summit)'),
23+
new OA\Property(property: 'summit', ref: '#/components/schemas/Summit', description: 'Full Summit object when expanded (expand=summit)'),
2624
new OA\Property(property: 'member_id', type: 'integer', example: 123, description: 'Member ID when not expanded'),
27-
new OA\Property(property: 'member', type: 'Member', description: 'Full Member object (without email) when expanded (expand=member)'),
25+
new OA\Property(property: 'member', ref: '#/components/schemas/Member', description: 'Full Member object (without email) when expanded (expand=member)'),
2826
]
2927
)]
3028
class SummitTrackChairSchema {}
@@ -39,17 +37,15 @@ class SummitTrackChairSchema {}
3937
new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp'),
4038
new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp'),
4139
new OA\Property(
42-
property: 'categories',
43-
type: 'array',
44-
items: new OA\Items(type: ['integer', 'PresentationCategory']),
45-
description: 'Array of category IDs by default. Use expand=categories to get full objects. Use relations=categories to include'
40+
property: 'categories',
41+
type: 'array',
42+
items: new OA\Items(type: 'integer'),
43+
description: "Array of PresentationCategory ID, Use expand=categories to get full objects"
4644
),
47-
],
48-
anyOf: [
4945
new OA\Property(property: 'summit_id', type: 'integer', example: 10, description: 'Summit ID when not expanded'),
50-
new OA\Property(property: 'summit', type: 'Summit', description: 'Full Summit object when expanded (expand=summit)'),
46+
new OA\Property(property: 'summit', ref: '#/components/schemas/Summit', description: 'Full Summit object when expanded (expand=summit)'),
5147
new OA\Property(property: 'member_id', type: 'integer', example: 123, description: 'Member ID when not expanded'),
52-
new OA\Property(property: 'member', type: 'AdminMember', description: 'Full Member object (WITH email) when expanded (expand=member)'),
48+
new OA\Property(property: 'member', ref: '#/components/schemas/AdminMember', description: 'Full Member object (WITH email) when expanded (expand=member)'),
5349
]
5450
)]
5551
class AdminSummitTrackChairSchema {}

app/Swagger/schemas.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use App\Security\SummitScopes;
1010
use models\summit\RSVP;
1111
use OpenApi\Attributes as OA;
12+
use function Laravel\Prompts\form;
1213

1314
#[OA\Schema(
1415
schema: 'Owner',
@@ -308,6 +309,20 @@ class RSVPInvitationsAuthSchema
308309
new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518),
309310
new OA\Property(property: 'first_name', type: 'string', example: 'John'),
310311
new OA\Property(property: 'last_name', type: 'string', example: 'Doe'),
312+
new OA\Property(property: 'bio', type: 'string'),
313+
new OA\Property(property: 'gender', type: 'string'),
314+
new OA\Property(property: 'github_user', type: 'string'),
315+
new OA\Property(property: 'linked_in', type: 'string'),
316+
new OA\Property(property: 'irc', type: 'string'),
317+
new OA\Property(property: 'twitter', type: 'string'),
318+
new OA\Property(property: 'state', type: 'string'),
319+
new OA\Property(property: 'country', type: 'string'),
320+
new OA\Property(property: 'active', type: 'boolean'),
321+
new OA\Property(property: 'email_verified', type: 'boolean'),
322+
new OA\Property(property: 'pic', type: 'string', format: 'url'),
323+
new OA\Property(property: 'membership_type', type: 'string'),
324+
new OA\Property(property: 'candidate_profile_id', type: 'integer'),
325+
new OA\Property(property: 'company', type: 'string'),
311326
]
312327
)]
313328
class MemberSchema

0 commit comments

Comments
 (0)