Skip to content

Commit 60766b8

Browse files
fix: incorrect types and descriptions for errors
1 parent 664ba23 commit 60766b8

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use models\summit\ISummitRepository;
1818
use ModelSerializers\SerializerRegistry;
1919
use OpenApi\Attributes as OA;
20+
use Symfony\Component\HttpFoundation\Response;
2021
use utils\Filter;
2122
use utils\FilterElement;
2223

@@ -117,12 +118,12 @@ protected function getSummitRepository(): ISummitRepository
117118
description: 'Attendee badges retrieved successfully',
118119
content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitAttendeeBadgesResponse')
119120
),
120-
new OA\Response(response: 400, description: "Bad Request"),
121-
new OA\Response(response: 401, description: "Unauthorized"),
122-
new OA\Response(response: 403, description: "Forbidden"),
123-
new OA\Response(response: 404, description: "Not Found"),
124-
new OA\Response(response: 412, description: "Precondition Failed"),
125-
new OA\Response(response: 500, description: "Internal Server Error"),
121+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
122+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
123+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
124+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
125+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
126+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
126127
]
127128
)]
128129

@@ -223,12 +224,12 @@ function(){
223224
)
224225
)
225226
),
226-
new OA\Response(response: 400, description: "Bad Request"),
227-
new OA\Response(response: 401, description: "Unauthorized"),
228-
new OA\Response(response: 403, description: "Forbidden"),
229-
new OA\Response(response: 404, description: "Not Found"),
230-
new OA\Response(response: 412, description: "Precondition Failed"),
231-
new OA\Response(response: 500, description: "Internal Server Error"),
227+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
228+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
229+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
230+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
231+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
232+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
232233
]
233234
)]
234235

0 commit comments

Comments
 (0)