{"openapi":"3.0.0","info":{"title":"3DI API - Frontend","summary":"Connects the frontend with the backend","contact":{"name":"Secure Software Engineering @ University of Paderborn","url":"https://www.hni.uni-paderborn.de/sse/","email":"sek-sse@hni.upb.de"},"version":"0.0.1"},"servers":[{"url":"localhost","description":"the local server running on the system"}],"tags":[{"name":"User","description":"Endpoints that operate on users"},{"name":"Team","description":"Endpoints that operate on teams"},{"name":"Contest","description":"Endpoints that operate on contests"},{"name":"Announcement","description":"Endpoints that operate on the announcements of contests"}],"paths":{"/user":{"summary":"Handling users","get":{"tags":["User"],"summary":"Returns a list of all users","description":"This action can only be accessed by an admin.","operationId":"GET_USER-LIST","responses":{"200":{"description":"A list of all users can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"403":{"description":"A user that is not an admin tried to access this endpoint."}}},"post":{"tags":["User"],"summary":"Creates a new user","description":"This action can be accessed by any non-registered user that is able to access the webpage.","operationId":"CREATE_USER","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"201":{"description":"The user was created."},"400":{"description":"The payload is invalid. Returns the corresponding error message.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"message":{"type":"string","description":"the error message"}},"required":["message"]},"example":{"message":"Expected value of type integer, got string instead"}}}},"403":{"description":"A user accessed this endpoint although they are already logged in."},"409":{"description":"The username or email address is already taken."}}}},"/user/{userName}":{"summary":"Handling a specific user","get":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user.","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a user with a specific username","description":"This action can only be accessed by an admin.","operationId":"GET_USER","responses":{"200":{"description":"The user exists and can be returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The user does not exist and therefore none can be returned"}}},"head":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user.","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Checks if a user exists","description":"This action can be accessed by everyone.","operationId":"EXISTS_USER","responses":{"200":{"description":"The user exists"},"404":{"description":"The user does not exist"}}},"put":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user.","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Updates a user with a specific username","description":"This action can only be accessed by an admin or the user themself.","operationId":"UPDATE_USER","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"The user was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not an admin or the user themself tried to access this endpoint."},"404":{"description":"The user that should be updated does not exist."},"409":{"description":"The username or email address is already taken."}}},"delete":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Deletes a user with a specific username","description":"This action can only be accessed by an admin or the user themself.","operationId":"DELETE_USER","responses":{"200":{"description":"The user was deleted."},"403":{"description":"A user that is not an admin or the user themself tried to access this endpoint."},"404":{"description":"The user that should be deleted does not exist."}}}},"/user/{userName}/password":{"summary":"Handling the password reset","delete":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user.","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Requests the password reset for a user and therefore sends them an email with instructions","description":"This action can only be accessed by the user or an admin.","operationId":"RESET_PASSWORD","responses":{"200":{"description":"The request was successful and an email has been sent."},"403":{"description":"A user that is not an admin or the user themself tried to access this endpoint."},"404":{"description":"The user that should be updated does not exist."}}},"patch":{"tags":["User"],"parameters":[{"name":"userName","in":"path","description":"the name that represents a specific user.","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Resets the password of a user","description":"This action can only be accessed by the user or an admin.","operationId":"SET_PASSWORD","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"password":{"type":"string","description":"the password"}},"required":["password"]},"example":{"password":"SecurePassword123"}}}},"responses":{"200":{"description":"The password was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not an admin or the user themself tried to access this endpoint."},"404":{"description":"The user that should be updated does not exist."},"422":{"description":"The password does not match the required format."}}}},"/team":{"summary":"Handling teams","get":{"tags":["Team"],"summary":"Returns a list of all teams","description":"This action can only be accessed by an admin.","operationId":"GET_TEAM-LIST","responses":{"200":{"description":"A list of all teams can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Team"}}}}},"403":{"description":"A user that is not an admin tried to access this endpoint."}}},"post":{"tags":["Team"],"summary":"Creates a new team","description":"This action can only be accessed by a logged in user.","operationId":"CREATE_TEAM","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"responses":{"201":{"description":"The team was created."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not logged in."},"409":{"description":"The team name is already taken."}}}},"/team/{teamName}":{"summary":"Handling a specific team","get":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a team with a specific team name","description":"This action can be accessed by everyone.","operationId":"GET_TEAM","responses":{"200":{"description":"The team exists and can be returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"404":{"description":"The team does not exist and therefore none can be returned"}}},"head":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Checks if a team exists","description":"This action can be accessed by everyone.","operationId":"EXISTS_TEAM","responses":{"200":{"description":"The team exists"},"404":{"description":"The team does not exist"}}},"put":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Updates a team with a specific team name","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"UPDATE_TEAM","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"responses":{"200":{"description":"The team was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The team that should be updated does not exist."},"409":{"description":"The team name is already taken."}}},"delete":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Deletes a team with a specific team name","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"DELETE_TEAM","responses":{"200":{"description":"The team was deleted."},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The team that should be deleted does not exist."}}}},"/team/{teamName}/member":{"summary":"Handles the members in a team","get":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a list of all members in a specific team","description":"This action can only be accessed by an admin or a member of that team.","operationId":"GET_TEAM_MEMBER-LIST","responses":{"200":{"description":"The team exists and a list of all members can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Team"}}}}},"403":{"description":"A user that is not an admin or a member of the team tried to access this endpoint."},"404":{"description":"The team does not exist and therefore no list can be returned."}}}},"/team/{teamName}/member/{userName}":{"summary":"Handles a specific member in a team","post":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"userName","in":"path","description":"the name that represents a specific user","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Adds a new member to a specific team","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"ADD_MEMBER_TEAM","responses":{"200":{"description":"The member was added."},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The team or the user does not exist."},"409":{"description":"The user is already a member of that team."}}},"delete":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"userName","in":"path","description":"the name that represents a specific user","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Removes a member from a specific team","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"REMOVE_MEMBER_TEAM","responses":{"200":{"description":"The member was removed."},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The team or the user does not exist."},"409":{"description":"The user is no member of that team and therefore cannot be removed."}}}},"/team/{teamName}/notification":{"summary":"Handles the notification feature","post":{"tags":["Team"],"parameters":[{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Sends an email notification to every member of a specific team","description":"This action can only be accessed by an admin.","operationId":"SEND_NOTIFICATION","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"message":{"type":"string","description":"message that should be sent to all the members of the team"}},"required":["message"]}}}},"responses":{"200":{"description":"The message was sent."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The team does not exist."}}}},"/contest":{"summary":"Handling contests","get":{"tags":["Contest"],"summary":"Returns a list of all contests","description":"This action can be accessed by everyone.","operationId":"GET_CONTEST-LIST","responses":{"200":{"description":"A list of all contests can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Contest"}}}}}}},"post":{"tags":["Contest"],"summary":"Creates a new contest","description":"This action can only be accessed by an admin.","operationId":"CREATE_CONTEST","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contest"}}}},"responses":{"201":{"description":"The contest was created."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not an admin."},"409":{"description":"The contest id is already taken."}}}},"/contest/{contestId}":{"summary":"Handling a specific contest","get":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a specific contest","description":"This action can be accessed by everyone.","operationId":"GET_CONTEST","responses":{"200":{"description":"The contest exists and can be returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contest"}}}},"404":{"description":"The contest does not exist and therefore none can be returned"}}},"head":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Checks if a contest exists","description":"This action can be accessed by everyone.","operationId":"EXISTS_CONTEST","responses":{"200":{"description":"The contest exists"},"404":{"description":"The contest does not exist"}}},"put":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Updates a specific contest.","description":"This action can only be accessed by an admin.","operationId":"UPDATE_CONTEST","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contest"}}}},"responses":{"200":{"description":"The contest was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The contest that should be updated does not exist."},"409":{"description":"The contest id is already taken."}}},"delete":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Deletes a specific contest","description":"This action can only be accessed by an admin.","operationId":"DELETE_CONTEST","responses":{"200":{"description":"The contest was deleted."},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The contest that should be deleted does not exist."}}}},"/contest/{contestId}/announcement":{"summary":"Handling announcements","get":{"tags":["Announcement"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a list of all announcements for a contest","description":"This action can only be accessed by admins and users who participate in the contest.","operationId":"GET_ANNOUNCEMENT-LIST","responses":{"200":{"description":"A list of all announcements can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Announcement"}}}}},"403":{"description":"A user that is not an admin or a participant of the contest tried to access this endpoint."},"404":{"description":"The contest does not exist."}}},"post":{"tags":["Announcement"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Creates a new announcement for a specific contest","description":"This action can only be accessed by an admin.","operationId":"CREATE_ANNOUNCEMENT","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"responses":{"201":{"description":"The announcement was created."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not an admin."},"409":{"description":"The announcement id is already taken."}}}},"/contest/{contestId}/announcement/{announcementId}":{"summary":"Handling a specific announcements","get":{"tags":["Announcement"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"announcementId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a specific announcement","description":"This action can only be accessed by admins and users who participate in the contest.","operationId":"GET_ANNOUNCEMENT","responses":{"200":{"description":"The announcement can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Announcement"}}}}},"403":{"description":"A user that is not an admin or a participant of the contest tried to access this endpoint."},"404":{"description":"The contest or the announcement does not exist."}}},"put":{"tags":["Announcement"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"announcementId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Updates an announcement for a specific contest","description":"This action can only be accessed by an admin.","operationId":"UPDATE_ANNOUNCEMENT","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"responses":{"200":{"description":"The announcement was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not an admin."},"404":{"description":"The contest or the announcement that should be updated does not exist."},"409":{"description":"The announcement id is already taken."}}},"delete":{"tags":["Announcement"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"announcementId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Deletes a specific announcement","description":"This action can only be accessed by an admin.","operationId":"DELETE_ANNOUNCEMENT","responses":{"200":{"description":"The announcement was deleted."},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The announcement that should be deleted does not exist."}}}},"/contest/{contestId}/team":{"summary":"Handling the teams in a specific contest","get":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a list of all teams in a specific contest","description":"This action can only be accessed by an admin or a user who participates in this contest.","operationId":"GET_TEAM","responses":{"200":{"description":"The contest exists and therefore a list of teams can be returned","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Team"}}}}},"403":{"description":"A user that is not an admin or participating in this contest tried to access this endpoint."},"404":{"description":"The contest does not exist and therefore no list can be returned"}}}},"/contest/{contestId}/team/{teamName}":{"summary":"Handles a specific team in a contest","post":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Adds a new team to a specific contest","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"ADD_TEAM_CONTEST","responses":{"200":{"description":"The team was added."},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The contest or the team does not exist."},"409":{"description":"The team is already participating in that contest."}}},"delete":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Removes a team from a specific contest","description":"This action can only be accessed by an admin or an admin of the team.","operationId":"REMOVE_TEAM_CONTEST","responses":{"200":{"description":"The team was removed."},"403":{"description":"A user that is not an admin or admin of the team tried to access this endpoint."},"404":{"description":"The contest or the team does not exist."},"409":{"description":"The team is not participating in that contest and therefore cannot be removed."}}}},"/contest/{contestId}/team/{teamName}/submission/{phaseType}":{"summary":"Handling the submissions by a team in a contest","get":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"phaseType","in":"path","description":"a specific phase in the contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a list of all submissions by a team in a specific contest","description":"This action can only be accessed by an admin or a user who is a member of the team.","operationId":"GET_SUBMISSIONS_TEAM_CONTEST","responses":{"200":{"description":"The contest and the team exist and therefore a list of submissions can be returned","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Submission"}}}}},"403":{"description":"A user that is not an admin or not a member of the team tried to access this endpoint."},"404":{"description":"The contest or the team does not exist and therefore no list can be returned"}}},"post":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"phaseType","in":"path","description":"a specific phase in the contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Hands in a new submission for a specific team","description":"This action can only be accessed by a user who is a member of the team.","operationId":"CREATE_SUBMISSION_TEAM_CONTEST","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionRequest"}}}},"responses":{"201":{"description":"The submission was handed in successfully."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user that is not a member of the team tried to access this endpoint."},"404":{"description":"The team, contest or phase type does not exist."},"429":{"description":"The limit of submissions in a certain time limit was reached. The user has to wait before handing in a new submission."}}}},"/contest/{contestId}/team/{teamName}/submission/{phaseType}/{submissionId}":{"summary":"Handling the submissions by a team in a contest","get":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"teamName","in":"path","description":"the name that represents a specific team","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"phaseType","in":"path","description":"a specific phase in the contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"submissionId","in":"path","description":"a specific submission in the contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns information about a specific submission","description":"This action can only be accessed by an admin or a user who is a member of the team.","operationId":"GET_SUBMISSION_TEAM_CONTEST","responses":{"200":{"description":"The contest, the team and the submission exist and therefore the submission can be returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submission"}}}},"403":{"description":"A user that is not an admin or not a member of the team tried to access this endpoint."},"404":{"description":"The contest, the team or the submission does not exist and therefore none can be returned."}}}},"/contest/{contestId}/test":{"summary":"Handling the tests in a specific contest","get":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Returns a list of all tests in a specific contest","description":"This action can only be accessed by an admin.","operationId":"GET_TEST","responses":{"200":{"description":"The contest exists and therefore a list of teams can be returned.","content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"array","items":{"$ref":"#/components/schemas/Test"}}}}},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The contest does not exist and therefore no list can be returned."}}},"post":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Creates a new test for a specific contest","description":"This action can only be accessed by an admin.","operationId":"CREATE_TEST","responses":{"201":{"description":"The test was created."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not an admin."},"409":{"description":"The test id is already taken."}}}},"/contest/{contestId}/test/{testId}":{"summary":"Handles a specific test in a contest","put":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"testId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Updates a test for a specific contest","description":"This action can only be accessed by an admin.","operationId":"UPDATE_TEST","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"responses":{"200":{"description":"The test was updated."},"400":{"$ref":"#/paths/~1user/post/responses/400"},"403":{"description":"A user accessed this endpoint although they are not an admin."},"404":{"description":"The contest or the test that should be updated does not exist."},"409":{"description":"The test id is already taken."}}},"delete":{"tags":["Contest"],"parameters":[{"name":"contestId","in":"path","description":"the id that represents a specific contest","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}},{"name":"testId","in":"path","description":"the name that represents a specific test","required":true,"schema":{"$schema":"http://json-schema.org/draft-04/schema#","type":"string"}}],"summary":"Removes a test from a specific contest","description":"This action can only be accessed by an admin.","operationId":"REMOVE_TEST_CONTEST","responses":{"200":{"description":"The test was removed."},"403":{"description":"A user that is not an admin tried to access this endpoint."},"404":{"description":"The contest or the test does not exist."}}}}},"components":{"schemas":{"Announcement":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"uuid":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"hasPriority":{"type":"boolean","default":false}},"required":["title","message"]},"Contest":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"uuid":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"viewScores":{"type":"boolean"},"specification":{"type":"string"},"phases":{"type":"array","items":{"$ref":"#/components/schemas/Phase"},"minItems":1},"announcements":{"type":"array","items":{"$ref":"#/components/schemas/Announcement"},"default":[]}},"required":["key","name","viewScores","specification","phases"]},"Phase":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"type":{"$ref":"#/components/schemas/PhaseType"},"begin":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["type","begin","end"]},"PhaseType":{"$schema":"http://json-schema.org/draft-04/schema#","type":"integer","oneOf":[{"title":"BUILD","const":0,"description":"Build-It Phase"},{"title":"BREAK","const":1,"description":"Break-It Phase"},{"title":"FIX","const":2,"description":"Fix-It Phase"}]},"Scoreboard":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"teamName":{"type":"string"},"position":{"type":"integer"},"score":{"type":["number","null"]}},"required":["teamName","position"]}}},"required":["entries"]},"Submission":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"uuid":{"type":"string"},"status":{"$ref":"#/components/schemas/SubmissionStatus"},"submitted":{"type":"string","format":"date-time"}},"required":["status"]},"SubmissionRequest":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"userName":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}}},"default":[]},"commands":{"type":"array","items":{"type":"string"},"default":[]}},"required":["userName"]},"SubmissionStatus":{"$schema":"http://json-schema.org/draft-04/schema#","type":"integer","oneOf":[{"title":"PENDING","const":0,"description":"The build and the tests are still in execution"},{"title":"BUILD_FAILED","const":1,"description":"The build failed"},{"title":"BUILD_SUCCESS","const":2,"description":"The build was successful"},{"title":"TIMEOUT","const":3,"description":"The build or one of the tests took too long"},{"title":"UNKNOWN_ERROR","const":4,"description":"An unknown error occurred"}]},"Team":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"uuid":{"type":"string"},"name":{"type":"string"},"members":{"type":"array","items":{"type":"string","description":"the username of the member"},"minItems":1},"admins":{"type":"array","items":{"type":"string","description":"the username of the member"},"minItems":1},"contests":{"type":"array","default":[],"items":{"$ref":"#/components/schemas/Contest"}}},"required":["name","members","contests"]},"Test":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"uuid":{"type":"string"},"name":{"type":"string"},"script":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string"},"output":{"type":"string","default":""},"exitCode":{"type":"integer","default":0}},"required":["input"]}},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string","contentEncoding":"base64"}},"required":["name","content"]}},"isOptional":{"type":"boolean"},"isPerformance":{"type":"boolean"},"isPrivate":{"type":"boolean"},"scoreWeight":{"type":"number","default":1}},"required":["name","isOptional","isPerformance","isPrivate"]},"TestResult":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"test":{"$ref":"#/components/schemas/Test"},"resultType":{"$ref":"#/components/schemas/TestResultType"},"score":{"type":"number"}},"required":["test","resultType"]},"TestResultType":{"$schema":"http://json-schema.org/draft-04/schema#","type":"integer","oneOf":[{"title":"PASSED","const":0,"description":"The test was passed"},{"title":"FAILED","const":1,"description":"The test was not passed"},{"title":"TIMEOUT","const":2,"description":"The test took too long to execute"}]},"User":{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"username":{"type":"string","pattern":"([A-Za-z0-9_-])","minLength":2,"description":"the unique username of a user"},"email":{"type":"string","format":"email","description":"the email address of the user"},"isAdmin":{"type":"boolean","default":false,"description":"if the user is an admin of the platform or not"},"teams":{"type":"array","default":[],"items":{"type":"string","description":"the names of the teams"},"description":"the teams the user is part of"}},"required":["username","email","isAdmin"]}}}}