Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta views #480

Merged
merged 109 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
3ce0d8b
added initial meta views
eceltov Nov 14, 2024
3cb526f
added support for shallow meta views
eceltov Nov 20, 2024
3c6bf16
added validator logic for meta views WIP
eceltov Dec 5, 2024
0d3ca08
merged with swagger branch
eceltov Dec 11, 2024
0bd18c5
merged with swagger branch, formatted meta-format files
eceltov Dec 11, 2024
a0459bc
added a mechanism that can read format definitions from a folder
eceltov Dec 11, 2024
a1adcc6
replaced annotations with attributes in format classes
eceltov Dec 13, 2024
106c6ea
Merge remote-tracking branch 'origin/master' into meta-views
eceltov Dec 13, 2024
c98bad2
each class field can now be checked individually, added cache for ref…
eceltov Dec 16, 2024
bb5f8ee
added user format, changed the registration endpoint to accept a requ…
eceltov Dec 17, 2024
aaf4ea6
added recursion to validation, made structural validation a public me…
eceltov Dec 17, 2024
0372e5b
format fields can now be attributed with request details
eceltov Dec 18, 2024
9143986
Merge remote-tracking branch 'origin/master' into meta-views
eceltov Jan 3, 2025
4bfa8f3
renamed RequestAttribute to FormatParameterAttribute
eceltov Jan 3, 2025
8d9d52d
added attribute to substitue @Param, added script to convert files wi…
eceltov Jan 4, 2025
b931803
added validators, added extraction method for RequestParamAttribute m…
eceltov Jan 5, 2025
d02392a
changed some presenter descriptions to combat regex catastrophic back…
eceltov Jan 5, 2025
73ee0a1
changed presenter description to avoid a bug in the attribute convert…
eceltov Jan 5, 2025
ba23bfe
the swagger generator is now attribute-based, added empty validators …
eceltov Jan 5, 2025
19be393
added support for loose attribute validation
eceltov Jan 5, 2025
e497148
added fields to attributes for extraction, formats are now referenced…
eceltov Jan 23, 2025
b79bad0
loose attributes work now (requestFormatInstance is now created prope…
eceltov Jan 23, 2025
42934b0
loose attributes now support nullability
eceltov Jan 23, 2025
f8991d1
merged FieldFormatDefinition and RequestParamData - now all checks ar…
eceltov Jan 23, 2025
5dd69c4
improved swagger typing, added swagger descriptions
eceltov Jan 24, 2025
8763ca0
unannotated path params are now handled properly
eceltov Jan 24, 2025
fb56a60
the annotation to attribute converter no longer uses hardcoded string…
eceltov Jan 29, 2025
7ebda6d
replaced single backslashes with double in namespace paths
eceltov Jan 29, 2025
c2c16b5
renamed various classes used in parameter attributes to make them sho…
eceltov Jan 29, 2025
b673fb8
added automatic multiline attribute conversions for long annotations
eceltov Feb 14, 2025
61b7f54
Merge branch 'master' into meta-views
eceltov Feb 14, 2025
3ae231d
refactored attribute converter
eceltov Feb 14, 2025
1498e76
added mechanism for path/query parameter detection WIP
eceltov Feb 15, 2025
c190b5f
added support for @param annotation to attribute conversion
eceltov Feb 16, 2025
5bed864
removed deprecated conversion mechanism
eceltov Feb 16, 2025
d6f0d09
bugfix: converted attributes are no longer used multiple times
eceltov Feb 16, 2025
3b4c253
restructured code
eceltov Feb 16, 2025
585dda5
improved code quality, added more comments
eceltov Feb 16, 2025
2f06e9a
missing validations are defaulted to string
eceltov Feb 16, 2025
8de1c28
single validators no longer need to be in arrays
eceltov Feb 17, 2025
8630379
bugfix: validators are now converted to arrays in attributes, descrip…
eceltov Feb 17, 2025
85c40fe
path param values are no longer checked (there is no mechanism for th…
eceltov Feb 17, 2025
6d13d82
added shorthands for attributes with a given type
eceltov Feb 17, 2025
e54eae5
code quality improvement
eceltov Feb 18, 2025
6148642
removed duplicit validator parameter
eceltov Feb 18, 2025
2988669
removed logging in the base presenter, removed format attribute and m…
eceltov Feb 18, 2025
042f2f3
@param annotations are removed after conversion
eceltov Feb 20, 2025
8078b72
converted endpoints
eceltov Feb 20, 2025
1ea5bc1
bugfix: attributes derived from Param are now also considered for val…
eceltov Feb 20, 2025
99a41b8
bugfix: InvalidArgumentExceptions are no longer intercepted.
eceltov Feb 20, 2025
8c14400
removed unnecessary rethrow mechanism
eceltov Feb 20, 2025
2a57dee
actionValidatePasswordStrength password is now nullable
eceltov Feb 20, 2025
b05b6bf
added mixed placeholder validator
eceltov Feb 20, 2025
5025336
added VMixed validator as a placeholder for params with missing valid…
eceltov Feb 20, 2025
da2bf97
refactored the conversion command
eceltov Feb 20, 2025
38ff805
bugfix: changed command name in config
eceltov Feb 20, 2025
57f9d73
implementing validators WIP
eceltov Feb 20, 2025
1972586
implemented int validator
eceltov Feb 20, 2025
6e701c8
renamed VFloat to VDouble
eceltov Feb 20, 2025
0ad910e
made parameter error messages more verbose
eceltov Feb 20, 2025
14dbbff
changed error message
eceltov Feb 20, 2025
cd8c805
int validator now supports numeric strings
eceltov Feb 20, 2025
c400a1f
implemented more validators
eceltov Feb 20, 2025
a9a5764
Merge branch 'master' into meta-views
eceltov Feb 21, 2025
ffee4a5
resolved some todos
eceltov Feb 21, 2025
184bfe1
bool validator now supports 1 and 0 as well
eceltov Feb 21, 2025
8c358c4
swagger generator extracts data only from attributes now
eceltov Feb 21, 2025
a28887c
implemented VTimestamp
eceltov Feb 21, 2025
9bbfd26
added more comments to validators
eceltov Feb 21, 2025
a20fafd
removed circular dependency of the annotation converter on the produc…
eceltov Feb 21, 2025
a165107
checkedAssign now explicitly throws when an invalid value is passed, …
eceltov Feb 21, 2025
2b61283
fixed param comment
eceltov Feb 21, 2025
b724809
added shorthands for format parameter attributes
eceltov Feb 21, 2025
9a850fc
removed MetaRequest, refactored actionCreateInvitation to use a forma…
eceltov Feb 21, 2025
9bf3a44
bugfix: loose params are no longer saved
eceltov Feb 21, 2025
4e96b1f
resolved todo
eceltov Feb 21, 2025
449d164
refactored the FormatCache
eceltov Feb 21, 2025
051247d
code cleanup
eceltov Feb 21, 2025
dae8c9b
replaced string slice with str_starts_with
eceltov Feb 27, 2025
cfa83e5
inlined function
eceltov Feb 27, 2025
9b20a75
replaced switch with translation dictionary
eceltov Feb 27, 2025
81f25e5
removed hardcoded namespaces where possible
eceltov Feb 27, 2025
9fc4ab5
added comment
eceltov Feb 27, 2025
971c77e
replaced hardcoded numbers
eceltov Feb 27, 2025
74eba85
replaced switch with dictionary
eceltov Feb 27, 2025
a86d53b
inlined a function
eceltov Feb 27, 2025
1d1f32c
replaced comments with doc-comments
eceltov Feb 27, 2025
8c7de0e
replaced comments with doc-comments
eceltov Feb 27, 2025
9f08c53
added type checking comparison
eceltov Feb 27, 2025
b2ee348
added type checking comparison
eceltov Feb 27, 2025
9af19f3
bugfix: added nullability to field
eceltov Feb 27, 2025
424a49b
bugfix: explicitly set nullability of a parameter is now considered a…
eceltov Feb 27, 2025
728de68
simplified doc-comment typename
eceltov Feb 27, 2025
efa5084
renamed file to match class name
eceltov Feb 27, 2025
b52d924
improved attribute class description
eceltov Feb 27, 2025
311e9fa
fixed misleading attribute comments
eceltov Feb 27, 2025
ec70d27
improved FormatCache::formatExists performance, added getter for a ha…
eceltov Feb 27, 2025
13361ad
added doc-comment for UserFormat
eceltov Feb 27, 2025
7003162
changed validator
eceltov Feb 27, 2025
d3e649f
removed deprecated method
eceltov Feb 27, 2025
a7b342b
improved VDouble validation
eceltov Feb 27, 2025
29a03e3
improved VInt validation
eceltov Feb 27, 2025
14b11df
improved VString validation
eceltov Feb 27, 2025
c0335c5
made VBool stricter
eceltov Feb 28, 2025
74c55a7
removed gettype type validation
eceltov Feb 28, 2025
f9d4ca3
tests now send proper booleans to endpoints instead of strings and ints
eceltov Feb 28, 2025
a7b607f
VBool now supports 'false' for one test to pass
eceltov Feb 28, 2025
311f567
added a todo regarding VBool
eceltov Mar 1, 2025
687e7e1
bugfix: removed erroneous query param
eceltov Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 56 additions & 25 deletions app/V1Module/presenters/AssignmentSolutionReviewsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

namespace App\V1Module\Presenters;

use App\Helpers\MetaFormats\Attributes\Post;
use App\Helpers\MetaFormats\Attributes\Query;
use App\Helpers\MetaFormats\Attributes\Path;
use App\Helpers\MetaFormats\Type;
use App\Helpers\MetaFormats\Validators\VArray;
use App\Helpers\MetaFormats\Validators\VBool;
use App\Helpers\MetaFormats\Validators\VDouble;
use App\Helpers\MetaFormats\Validators\VEmail;
use App\Helpers\MetaFormats\Validators\VInt;
use App\Helpers\MetaFormats\Validators\VMixed;
use App\Helpers\MetaFormats\Validators\VString;
use App\Helpers\MetaFormats\Validators\VTimestamp;
use App\Helpers\MetaFormats\Validators\VUuid;
use App\Exceptions\BadRequestException;
use App\Exceptions\InternalServerException;
use App\Exceptions\InvalidArgumentException;
Expand Down Expand Up @@ -88,9 +101,9 @@ public function checkDefault(string $id)
/**
* Get detail of the solution and a list of review comments.
* @GET
* @param string $id identifier of the solution
* @throws InternalServerException
*/
#[Path("id", new VString(), "identifier of the solution", required: true)]
public function actionDefault(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand All @@ -111,11 +124,10 @@ public function checkUpdate(string $id)
/**
* Update the state of the review process of the solution.
* @POST
* @Param(type="post", name="close", validation="bool"
* description="If true, the review is closed. If false, the review is (re)opened.")
* @param string $id identifier of the solution
* @throws InternalServerException
*/
#[Post("close", new VBool(), "If true, the review is closed. If false, the review is (re)opened.")]
#[Path("id", new VString(), "identifier of the solution", required: true)]
public function actionUpdate(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -182,9 +194,9 @@ public function checkRemove(string $id)
/**
* Update the state of the review process of the solution.
* @DELETE
* @param string $id identifier of the solution
* @throws InternalServerException
*/
#[Path("id", new VString(), "identifier of the solution", required: true)]
public function actionRemove(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -251,18 +263,29 @@ private function verifyCodeLocation(AssignmentSolution $solution, string $file,
/**
* Create a new comment within a review.
* @POST
* @Param(type="post", name="text", validation="string:1..65535", required=true, description="The comment itself.")
* @Param(type="post", name="file", validation="string:0..256", required=true,
* description="Identification of the file to which the comment is related to.")
* @Param(type="post", name="line", validation="numericint", required=true,
* description="Line in the designated file to which the comment is related to.")
* @Param(type="post", name="issue", validation="bool", required=false,
* description="Whether the comment is an issue (expected to be resolved by the student)")
* @Param(type="post", name="suppressNotification", validation="bool", required=false,
* description="If true, no email notification will be sent (only applies when the review has been closed)")
* @param string $id identifier of the solution
* @throws InternalServerException
*/
#[Post("text", new VString(1, 65535), "The comment itself.", required: true)]
#[Post(
"file",
new VString(0, 256),
"Identification of the file to which the comment is related to.",
required: true,
)]
#[Post("line", new VInt(), "Line in the designated file to which the comment is related to.", required: true)]
#[Post(
"issue",
new VBool(),
"Whether the comment is an issue (expected to be resolved by the student)",
required: false,
)]
#[Post(
"suppressNotification",
new VBool(),
"If true, no email notification will be sent (only applies when the review has been closed)",
required: false,
)]
#[Path("id", new VString(), "identifier of the solution", required: true)]
public function actionNewComment(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -320,15 +343,23 @@ public function checkEditComment(string $id, string $commentId)
/**
* Update existing comment within a review.
* @POST
* @Param(type="post", name="text", validation="string:1..65535", required=true, description="The comment itself.")
* @Param(type="post", name="issue", validation="bool", required=false,
* description="Whether the comment is an issue (expected to be resolved by the student)")
* @Param(type="post", name="suppressNotification", validation="bool", required=false,
* description="If true, no email notification will be sent (only applies when the review has been closed)")
* @param string $id identifier of the solution
* @param string $commentId identifier of the review comment
* @throws InternalServerException
*/
#[Post("text", new VString(1, 65535), "The comment itself.", required: true)]
#[Post(
"issue",
new VBool(),
"Whether the comment is an issue (expected to be resolved by the student)",
required: false,
)]
#[Post(
"suppressNotification",
new VBool(),
"If true, no email notification will be sent (only applies when the review has been closed)",
required: false,
)]
#[Path("id", new VString(), "identifier of the solution", required: true)]
#[Path("commentId", new VString(), "identifier of the review comment", required: true)]
public function actionEditComment(string $id, string $commentId)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -386,9 +417,9 @@ public function checkDeleteComment(string $id, string $commentId)
/**
* Remove one comment from a review.
* @DELETE
* @param string $id identifier of the solution
* @param string $commentId identifier of the review comment
*/
#[Path("id", new VString(), "identifier of the solution", required: true)]
#[Path("commentId", new VString(), "identifier of the review comment", required: true)]
public function actionDeleteComment(string $id, string $commentId)
{
$comment = $this->reviewComments->findOrThrow($commentId);
Expand Down Expand Up @@ -422,8 +453,8 @@ public function checkPending(string $id)
* Return all solutions with pending reviews that given user teaches (is admin/supervisor in corresponding groups).
* Along with that it returns all assignment entities of the corresponding solutions.
* @GET
* @param string $id of the user whose pending reviews are listed
*/
#[Path("id", new VString(), "of the user whose pending reviews are listed", required: true)]
public function actionPending(string $id)
{
$user = $this->users->findOrThrow($id);
Expand Down
58 changes: 37 additions & 21 deletions app/V1Module/presenters/AssignmentSolutionsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

namespace App\V1Module\Presenters;

use App\Helpers\MetaFormats\Attributes\Post;
use App\Helpers\MetaFormats\Attributes\Query;
use App\Helpers\MetaFormats\Attributes\Path;
use App\Helpers\MetaFormats\Type;
use App\Helpers\MetaFormats\Validators\VArray;
use App\Helpers\MetaFormats\Validators\VBool;
use App\Helpers\MetaFormats\Validators\VDouble;
use App\Helpers\MetaFormats\Validators\VEmail;
use App\Helpers\MetaFormats\Validators\VInt;
use App\Helpers\MetaFormats\Validators\VMixed;
use App\Helpers\MetaFormats\Validators\VString;
use App\Helpers\MetaFormats\Validators\VTimestamp;
use App\Helpers\MetaFormats\Validators\VUuid;
use App\Exceptions\BadRequestException;
use App\Exceptions\InternalServerException;
use App\Exceptions\InvalidArgumentException;
Expand Down Expand Up @@ -142,9 +155,9 @@ public function checkSolution(string $id)
/**
* Get information about solutions.
* @GET
* @param string $id Identifier of the solution
* @throws InternalServerException
*/
#[Path("id", new VString(), "Identifier of the solution", required: true)]
public function actionSolution(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -172,11 +185,11 @@ public function checkUpdateSolution(string $id)
/**
* Update details about the solution (note, etc...)
* @POST
* @Param(type="post", name="note", validation="string:0..1024", description="A note by the author of the solution")
* @param string $id Identifier of the solution
* @throws NotFoundException
* @throws InternalServerException
*/
#[Post("note", new VString(0, 1024), "A note by the author of the solution")]
#[Path("id", new VString(), "Identifier of the solution", required: true)]
public function actionUpdateSolution(string $id)
{
$req = $this->getRequest();
Expand All @@ -198,9 +211,9 @@ public function checkDeleteSolution(string $id)
/**
* Delete assignment solution with given identification.
* @DELETE
* @param string $id identifier of assignment solution
* @throws ForbiddenRequestException
*/
#[Path("id", new VString(), "identifier of assignment solution", required: true)]
public function actionDeleteSolution(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -236,8 +249,8 @@ public function checkSubmissions(string $id)
/**
* Get list of all submissions of a solution
* @GET
* @param string $id Identifier of the solution
*/
#[Path("id", new VString(), "Identifier of the solution", required: true)]
public function actionSubmissions(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -271,10 +284,10 @@ public function checkSubmission(string $submissionId)
/**
* Get information about the evaluation of a submission
* @GET
* @param string $submissionId Identifier of the submission
* @throws NotFoundException
* @throws InternalServerException
*/
#[Path("submissionId", new VString(), "Identifier of the submission", required: true)]
public function actionSubmission(string $submissionId)
{
$submission = $this->assignmentSolutionSubmissions->findOrThrow($submissionId);
Expand All @@ -301,8 +314,8 @@ public function checkDeleteSubmission(string $submissionId)
/**
* Remove the submission permanently
* @DELETE
* @param string $submissionId Identifier of the submission
*/
#[Path("submissionId", new VString(), "Identifier of the submission", required: true)]
public function actionDeleteSubmission(string $submissionId)
{
$submission = $this->assignmentSolutionSubmissions->findOrThrow($submissionId);
Expand All @@ -327,15 +340,19 @@ public function checkSetBonusPoints(string $id)
* Set new amount of bonus points for a solution (and optionally points override)
* Returns array of solution entities that has been changed by this.
* @POST
* @Param(type="post", name="bonusPoints", validation="numericint",
* description="New amount of bonus points, can be negative number")
* @Param(type="post", name="overriddenPoints", required=false,
* description="Overrides points assigned to solution by the system")
* @param string $id Identifier of the solution
* @throws NotFoundException
* @throws InvalidArgumentException
* @throws InvalidStateException
*/
#[Post("bonusPoints", new VInt(), "New amount of bonus points, can be negative number")]
#[Post(
"overriddenPoints",
new VMixed(),
"Overrides points assigned to solution by the system",
required: false,
nullable: true,
)]
#[Path("id", new VString(), "Identifier of the solution", required: true)]
public function actionSetBonusPoints(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand Down Expand Up @@ -423,14 +440,13 @@ public function checkSetFlag(string $id, string $flag)
/**
* Set flag of the assignment solution.
* @POST
* @param string $id identifier of the solution
* @param string $flag name of the flag which should to be changed
* @Param(type="post", name="value", required=true, validation=boolean,
* description="True or false which should be set to given flag name")
* @throws NotFoundException
* @throws \Nette\Application\AbortException
* @throws \Exception
*/
#[Post("value", new VBool(), "True or false which should be set to given flag name", required: true)]
#[Path("id", new VString(), "identifier of the solution", required: true)]
#[Path("flag", new VString(), "name of the flag which should to be changed", required: true)]
public function actionSetFlag(string $id, string $flag)
{
$req = $this->getRequest();
Expand Down Expand Up @@ -546,12 +562,12 @@ public function checkDownloadSolutionArchive(string $id)
/**
* Download archive containing all solution files for particular solution.
* @GET
* @param string $id of assignment solution
* @throws ForbiddenRequestException
* @throws NotFoundException
* @throws \Nette\Application\BadRequestException
* @throws \Nette\Application\AbortException
*/
#[Path("id", new VString(), "of assignment solution", required: true)]
public function actionDownloadSolutionArchive(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id);
Expand All @@ -573,10 +589,10 @@ public function checkFiles(string $id)
/**
* Get the list of submitted files of the solution.
* @GET
* @param string $id of assignment solution
* @throws ForbiddenRequestException
* @throws NotFoundException
*/
#[Path("id", new VString(), "of assignment solution", required: true)]
public function actionFiles(string $id)
{
$solution = $this->assignmentSolutions->findOrThrow($id)->getSolution();
Expand All @@ -594,11 +610,11 @@ public function checkDownloadResultArchive(string $submissionId)
/**
* Download result archive from backend for particular submission.
* @GET
* @param string $submissionId
* @throws NotFoundException
* @throws InternalServerException
* @throws \Nette\Application\AbortException
*/
#[Path("submissionId", new VString(), required: true)]
public function actionDownloadResultArchive(string $submissionId)
{
$submission = $this->assignmentSolutionSubmissions->findOrThrow($submissionId);
Expand Down Expand Up @@ -628,10 +644,10 @@ public function checkEvaluationScoreConfig(string $submissionId)
/**
* Get score configuration associated with given submission evaluation
* @GET
* @param string $submissionId Identifier of the submission
* @throws NotFoundException
* @throws InternalServerException
*/
#[Path("submissionId", new VString(), "Identifier of the submission", required: true)]
public function actionEvaluationScoreConfig(string $submissionId)
{
$submission = $this->assignmentSolutionSubmissions->findOrThrow($submissionId);
Expand All @@ -655,8 +671,8 @@ public function checkReviewRequests(string $id)
* (is admin/supervisor in corresponding groups).
* Along with that it returns all assignment entities of the corresponding solutions.
* @GET
* @param string $id of the user whose solutions with requested reviews are listed
*/
#[Path("id", new VString(), "of the user whose solutions with requested reviews are listed", required: true)]
public function actionReviewRequests(string $id)
{
$user = $this->users->findOrThrow($id);
Expand Down
25 changes: 21 additions & 4 deletions app/V1Module/presenters/AssignmentSolversPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

namespace App\V1Module\Presenters;

use App\Helpers\MetaFormats\Attributes\Post;
use App\Helpers\MetaFormats\Attributes\Query;
use App\Helpers\MetaFormats\Attributes\Path;
use App\Helpers\MetaFormats\Type;
use App\Helpers\MetaFormats\Validators\VArray;
use App\Helpers\MetaFormats\Validators\VBool;
use App\Helpers\MetaFormats\Validators\VDouble;
use App\Helpers\MetaFormats\Validators\VEmail;
use App\Helpers\MetaFormats\Validators\VInt;
use App\Helpers\MetaFormats\Validators\VMixed;
use App\Helpers\MetaFormats\Validators\VString;
use App\Helpers\MetaFormats\Validators\VTimestamp;
use App\Helpers\MetaFormats\Validators\VUuid;
use App\Exceptions\BadRequestException;
use App\Model\Entity\AssignmentSolutionSubmission;
use App\Model\Repository\Assignments;
Expand Down Expand Up @@ -92,11 +105,15 @@ public function checkDefault(?string $assignmentId, ?string $groupId, ?string $u
* Get a list of assignment solvers based on given parameters (assignment/group and solver user).
* Either assignment or group ID must be set (group is ignored if assignment is set), user ID is optional.
* @GET
* @Param(type="query", name="assignmentId", required=false, validation="string:36")
* @Param(type="query", name="groupId", required=false, validation="string:36",
* description="An alternative for assignment ID, selects all assignments from a group.")
* @Param(type="query", name="userId", required=false, validation="string:36")
*/
#[Query("assignmentId", new VUuid(), required: false)]
#[Query(
"groupId",
new VUuid(),
"An alternative for assignment ID, selects all assignments from a group.",
required: false,
)]
#[Query("userId", new VUuid(), required: false)]
public function actionDefault(?string $assignmentId, ?string $groupId, ?string $userId): void
{
$user = $userId ? $this->users->findOrThrow($userId) : null;
Expand Down
Loading