Skip to content

Commit 8b735e5

Browse files
Fix OpenAPI spec for int path parameters and return type for fetching work.
Fixes #2355.
1 parent 07e3235 commit 8b735e5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

webapp/src/Controller/API/JudgehostController.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function updateJudgingAction(
279279
Request $request,
280280
#[OA\PathParameter(description: 'The hostname of the judgehost that wants to update the judging')]
281281
string $hostname,
282-
#[OA\PathParameter(description: 'The ID of the judgetask to update')]
282+
#[OA\PathParameter(description: 'The ID of the judgetask to update', schema: new OA\Schema(type: 'integer'))]
283283
int $judgetaskid
284284
): void {
285285
$judgehost = $this->em->getRepository(Judgehost::class)->findOneBy(['hostname' => $hostname]);
@@ -470,7 +470,7 @@ public function addDebugInfo(
470470
Request $request,
471471
#[OA\PathParameter(description: 'The hostname of the judgehost that wants to add the debug info')]
472472
string $hostname,
473-
#[OA\PathParameter(description: 'The ID of the judgetask to add')]
473+
#[OA\PathParameter(description: 'The ID of the judgetask to add', schema: new OA\Schema(type: 'integer'))]
474474
int $judgeTaskId
475475
): void {
476476
$judgeTask = $this->em->getRepository(JudgeTask::class)->find($judgeTaskId);
@@ -607,7 +607,7 @@ public function addJudgingRunAction(
607607
Request $request,
608608
#[OA\PathParameter(description: 'The hostname of the judgehost that wants to add the judging run')]
609609
string $hostname,
610-
#[OA\PathParameter(description: 'The ID of the judgetask to add')]
610+
#[OA\PathParameter(description: 'The ID of the judgetask to add', schema: new OA\Schema(type: 'integer'))]
611611
int $judgeTaskId
612612
): int {
613613
$required = [
@@ -1443,9 +1443,7 @@ private function getTestcaseFiles(string $id): array
14431443
description: 'Returns the workarray.',
14441444
content: new OA\JsonContent(
14451445
type: 'array',
1446-
items: new OA\Items(
1447-
new OA\Schema(ref: new Model(type: JudgeTask::class)),
1448-
)
1446+
items: new OA\Items(ref: new Model(type: JudgeTask::class))
14491447
)
14501448
)]
14511449
#[OA\Parameter(

0 commit comments

Comments
 (0)