Skip to content

Commit dcc3072

Browse files
committed
chore: Add file upload requestBody
Signed-off-by: Matias Perrone <github@matiasperrone.com>
1 parent 051ee0f commit dcc3072

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,14 @@ public function getLocationMap($summit_id, $location_id, $map_id)
26142614
new OA\Parameter(name: 'fields', in: 'query', required: false, description: 'Fields to return', schema: new OA\Schema(type: 'string')),
26152615
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relations to include', schema: new OA\Schema(type: 'string')),
26162616
],
2617+
requestBody: new OA\RequestBody(
2618+
description: 'Map file upload payload',
2619+
required: true,
2620+
content: new OA\MediaType(
2621+
mediaType: 'multipart/form-data',
2622+
schema: new OA\Schema(ref: '#/components/schemas/AddLocationMapPayload')
2623+
)
2624+
),
26172625
responses: [
26182626
new OA\Response(response: Response::HTTP_CREATED, description: 'Map created', content: new OA\JsonContent(ref: '#/components/schemas/SummitLocationMap')),
26192627
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit or Location Not Found'),
@@ -2701,6 +2709,14 @@ public function addLocationMap(LaravelRequest $request, $summit_id, $location_id
27012709
new OA\Parameter(name: 'fields', in: 'query', required: false, description: 'Fields to return', schema: new OA\Schema(type: 'string')),
27022710
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relations to include', schema: new OA\Schema(type: 'string')),
27032711
],
2712+
requestBody: new OA\RequestBody(
2713+
description: 'Map file update payload',
2714+
required: false,
2715+
content: new OA\MediaType(
2716+
mediaType: 'multipart/form-data',
2717+
schema: new OA\Schema(ref: '#/components/schemas/UpdateLocationMapPayload')
2718+
)
2719+
),
27042720
responses: [
27052721
new OA\Response(response: Response::HTTP_OK, description: 'Map updated', content: new OA\JsonContent(ref: '#/components/schemas/SummitLocationMap')),
27062722
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit, location, or map Not Found'),
@@ -2893,6 +2909,14 @@ public function getLocationImage($summit_id, $location_id, $image_id)
28932909
new OA\Parameter(name: 'fields', in: 'query', required: false, description: 'Fields to return', schema: new OA\Schema(type: 'string')),
28942910
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relations to include', schema: new OA\Schema(type: 'string')),
28952911
],
2912+
requestBody: new OA\RequestBody(
2913+
description: 'Image file upload payload',
2914+
required: true,
2915+
content: new OA\MediaType(
2916+
mediaType: 'multipart/form-data',
2917+
schema: new OA\Schema(ref: '#/components/schemas/AddLocationImagePayload')
2918+
)
2919+
),
28962920
responses: [
28972921
new OA\Response(response: Response::HTTP_CREATED, description: 'Image created', content: new OA\JsonContent(ref: '#/components/schemas/SummitLocationImage')),
28982922
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit or Location Not Found'),
@@ -3096,6 +3120,14 @@ public function deleteLocationImage($summit_id, $location_id, $image_id)
30963120
new OA\Parameter(name: 'fields', in: 'query', required: false, description: 'Fields to return', schema: new OA\Schema(type: 'string')),
30973121
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relations to include', schema: new OA\Schema(type: 'string')),
30983122
],
3123+
requestBody: new OA\RequestBody(
3124+
description: 'Room image file upload payload',
3125+
required: true,
3126+
content: new OA\MediaType(
3127+
mediaType: 'multipart/form-data',
3128+
schema: new OA\Schema(ref: '#/components/schemas/AddVenueRoomImagePayload')
3129+
)
3130+
),
30993131
responses: [
31003132
new OA\Response(response: Response::HTTP_CREATED, description: 'Room image added', content: new OA\JsonContent(ref: '#/components/schemas/SummitImage')),
31013133
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit, venue, or room Not Found'),
@@ -3253,6 +3285,14 @@ public function removeVenueRoomImage($summit_id, $venue_id, $room_id)
32533285
new OA\Parameter(name: 'fields', in: 'query', required: false, description: 'Fields to return', schema: new OA\Schema(type: 'string')),
32543286
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relations to include', schema: new OA\Schema(type: 'string')),
32553287
],
3288+
requestBody: new OA\RequestBody(
3289+
description: 'Floor image file upload payload',
3290+
required: true,
3291+
content: new OA\MediaType(
3292+
mediaType: 'multipart/form-data',
3293+
schema: new OA\Schema(ref: '#/components/schemas/AddVenueFloorImagePayload')
3294+
)
3295+
),
32563296
responses: [
32573297
new OA\Response(response: Response::HTTP_CREATED, description: 'Floor image added', content: new OA\JsonContent(ref: '#/components/schemas/SummitImage')),
32583298
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit, venue, or floor Not Found'),

app/Swagger/OAuth2SummitLocationsApiControllerSchemas.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,53 @@ class AddLocationImagePayloadSchema {}
611611
)]
612612
class UpdateLocationImagePayloadSchema {}
613613

614+
#[OA\Schema(
615+
schema: 'AddLocationMapPayload',
616+
type: 'object',
617+
description: 'Payload for uploading a location map (multipart form data)',
618+
required: ['file'],
619+
properties: [
620+
new OA\Property(property: 'file', type: 'string', format: 'binary', description: 'Map image file'),
621+
new OA\Property(property: 'name', type: 'string', description: 'Map name'),
622+
new OA\Property(property: 'description', type: 'string', description: 'Map description'),
623+
]
624+
)]
625+
class AddLocationMapPayloadSchema {}
626+
627+
#[OA\Schema(
628+
schema: 'UpdateLocationMapPayload',
629+
type: 'object',
630+
description: 'Payload for updating a location map (multipart form data)',
631+
properties: [
632+
new OA\Property(property: 'file', type: 'string', format: 'binary', description: 'Map image file (optional)'),
633+
new OA\Property(property: 'name', type: 'string', description: 'Map name'),
634+
new OA\Property(property: 'description', type: 'string', description: 'Map description'),
635+
]
636+
)]
637+
class UpdateLocationMapPayloadSchema {}
638+
639+
#[OA\Schema(
640+
schema: 'AddVenueRoomImagePayload',
641+
type: 'object',
642+
description: 'Payload for uploading a venue room image (multipart form data)',
643+
required: ['file'],
644+
properties: [
645+
new OA\Property(property: 'file', type: 'string', format: 'binary', description: 'Image file'),
646+
]
647+
)]
648+
class AddVenueRoomImagePayloadSchema {}
649+
650+
#[OA\Schema(
651+
schema: 'AddVenueFloorImagePayload',
652+
type: 'object',
653+
description: 'Payload for uploading a venue floor image (multipart form data)',
654+
required: ['file'],
655+
properties: [
656+
new OA\Property(property: 'file', type: 'string', format: 'binary', description: 'Image file'),
657+
]
658+
)]
659+
class AddVenueFloorImagePayloadSchema {}
660+
614661
#[OA\Schema(
615662
schema: 'AddVenueFloorRoomPayload',
616663
type: 'object',

0 commit comments

Comments
 (0)