Skip to content

Commit b3808e8

Browse files
fix: Reuse already defined schema and add Paginated Schema
1 parent 3694a4f commit b3808e8

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

app/Http/Controllers/Apis/LanguagesApiController.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,7 @@ public function __construct(ILanguageRepository $language_repository)
5858
new OA\Response(
5959
response: 200,
6060
description: 'Success - Returns paginated list of languages',
61-
content: new OA\JsonContent(
62-
properties: [
63-
'total' => new OA\Property(property: 'total', type: 'integer', example: 50),
64-
'per_page' => new OA\Property(property: 'per_page', type: 'integer', example: 50),
65-
'current_page' => new OA\Property(property: 'current_page', type: 'integer', example: 1),
66-
'last_page' => new OA\Property(property: 'last_page', type: 'integer', example: 1),
67-
'data' => new OA\Property(
68-
property: 'data',
69-
type: 'array',
70-
items: new OA\Items(
71-
properties: [
72-
'id' => new OA\Property(property: 'id', type: 'integer', example: 1),
73-
'name' => new OA\Property(property: 'name', type: 'string', example: 'English'),
74-
'iso_code' => new OA\Property(property: 'iso_code', type: 'string', example: 'en')
75-
],
76-
type: 'object'
77-
)
78-
)
79-
],
80-
type: 'object'
81-
)
61+
content: new OA\JsonContent(ref: '#/components/schemas/PaginatedISOElementResponseSchema'),
8262
),
8363
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
8464
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"),

0 commit comments

Comments
 (0)