Skip to content

Commit c184a14

Browse files
committed
Loosening validation of query bool params as non-strict (alowing also true/false as string inputs).
1 parent 143d192 commit c184a14

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/V1Module/presenters/AsyncJobsPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function checkList()
9999
)]
100100
#[Query(
101101
"includeScheduled",
102-
new VBool(),
102+
new VBool(false),
103103
"If true, pending scheduled events will be listed as well",
104104
required: false,
105105
nullable: true,

app/V1Module/presenters/ExercisesPresenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function checkAssignments(string $id)
514514
* @throws NotFoundException
515515
*/
516516
#[Path("id", new VUuid(), "Identifier of the exercise", required: true)]
517-
#[Query("archived", new VBool(), "Include also archived groups in the result", required: false)]
517+
#[Query("archived", new VBool(false), "Include also archived groups in the result", required: false)]
518518
public function actionAssignments(string $id, bool $archived = false)
519519
{
520520
$exercise = $this->exercises->findOrThrow($id);
@@ -797,7 +797,7 @@ public function checkTagsUpdateGlobal(string $tag)
797797
#[Query("renameTo", new VString(1, 32), "New name of the tag", required: false)]
798798
#[Query(
799799
"force",
800-
new VBool(),
800+
new VBool(false),
801801
"If true, the rename will be allowed even if the new tag name exists (tags will be merged). "
802802
. "Otherwise, name collisions will result in error.",
803803
required: false,

app/V1Module/presenters/GroupsPresenter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class GroupsPresenter extends BasePresenter
186186
#[Query("instanceId", new VString(), "Only groups of this instance are returned.", required: false, nullable: true)]
187187
#[Query(
188188
"ancestors",
189-
new VBool(),
189+
new VBool(false),
190190
"If true, returns an ancestral closure of the initial result set. "
191191
. "Included ancestral groups do not respect other filters (archived, search, ...).",
192192
required: false,
@@ -198,10 +198,10 @@ class GroupsPresenter extends BasePresenter
198198
required: false,
199199
nullable: true,
200200
)]
201-
#[Query("archived", new VBool(), "Include also archived groups in the result.", required: false)]
201+
#[Query("archived", new VBool(false), "Include also archived groups in the result.", required: false)]
202202
#[Query(
203203
"onlyArchived",
204-
new VBool(),
204+
new VBool(false),
205205
"Automatically implies \$archived flag and returns only archived groups.",
206206
required: false,
207207
)]

0 commit comments

Comments
 (0)