{ "schemes": [ "http" ], "swagger": "2.0", "info": { "description": "This is the API of Alexandria.", "title": "Alexandria API", "contact": {}, "version": "2.0" }, "host": "localhost:8080", "basePath": "/api/v2", "paths": { "/branches": { "post": { "description": "Create a new branch linked to a project post.\nNote that Member IDs passed here, get converted to Collaborator IDs.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Create new branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Branch Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.BranchCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchDTO" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/closed/{closedBranchID}": { "get": { "description": "Returns a closed branch given an id", "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Returns a closed branch", "parameters": [ { "type": "string", "description": "Closed Branch ID", "name": "closedBranchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ClosedBranchDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/collaborators/all/{branchID}": { "get": { "description": "Returns all branch collaborators of the branch with the given ID", "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Get all branch collaborators of a branch", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.BranchCollaboratorDTO" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/collaborators/{collaboratorID}": { "get": { "description": "Get a branch collaborator by ID, a member who has collaborated on a branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Get a branch collaborator by ID", "parameters": [ { "type": "string", "description": "Collaborator ID", "name": "collaboratorID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchCollaboratorDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/reviews": { "post": { "description": "Adds a branchreview to a branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Adds a branchreview to a branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "branchreview creation form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ReviewCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchReviewDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/reviews/{reviewID}": { "get": { "description": "Returns a branch review with given ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Returns a branch review", "parameters": [ { "type": "string", "description": "branchreview ID", "name": "reviewID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchReviewDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}": { "get": { "description": "Get a branch by branch ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Get branch", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "delete": { "description": "Delete a branch with given ID from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Delete a branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/can-review": { "get": { "description": "Returns true if the user fulfills the requirements to branchreview the branch.\nReturns false if user is unauthorized to branchreview the branch.\nThe member in question is inferred based on the access token.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Returns whether the user is allowed to branchreview this branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "boolean" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/discussions": { "get": { "description": "Returns all discussions on this version that are not a reply to another discussion\nEndpoint is offset-paginated", "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Returns all level 1 discussions associated with the version", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true }, { "type": "integer", "description": "page query", "name": "page", "in": "query" }, { "type": "integer", "description": "page size", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.DiscussionDTO" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/file/{filepath}": { "get": { "description": "Get the contents of a single file from a project of a branch", "produces": [ "application/octet-stream" ], "tags": [ "branches" ], "summary": "Get a file from a project", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true }, { "type": "string", "description": "Filepath", "name": "filepath", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/render": { "get": { "description": "Get the render of the repository underlying a branch if it exists and has been rendered successfully", "produces": [ "text/html" ], "tags": [ "branches" ], "summary": "Get the render of a branch", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "202": { "description": "Accepted", "schema": { "type": "array", "items": { "type": "integer" } } }, "204": { "description": "No Content", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/repository": { "get": { "description": "Get the entire zipped repository of a branch", "produces": [ "application/zip" ], "tags": [ "branches" ], "summary": "Get the repository of a branch", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/review-statuses": { "get": { "description": "Returns an array of the statuses of all the reviews of this branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Returns status of all branch reviews", "parameters": [ { "type": "string", "description": "branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.BranchOverallReviewStatus" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/tree": { "get": { "description": "Get the filetree of a project of a branch", "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Get the filetree of a project", "parameters": [ { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/branches/{branchID}/upload": { "post": { "description": "Upload a new project version to a specific, preexisting, branch as a zipped quarto project.\nSpecifically, this zip should contain all of the contents of the project at its root, not in a subdirectory.\nCall this after you create a post, and supply it with the actual post contents.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "branches" ], "summary": "Upload a new project version to a branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "Branch ID", "name": "branchID", "in": "path", "required": true }, { "type": "file", "description": "Repository to create", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussion-containers/{discussionContainerID}": { "get": { "description": "Get a discussion container by its ID, to access its discussions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussion-containers" ], "summary": "Get discussion container", "parameters": [ { "type": "string", "description": "Discussion Container ID", "name": "discussionContainerID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.DiscussionContainerDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussions/replies": { "post": { "description": "Create a new reply-type discussion, so a discussion that is a child of another discussion.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Create new reply discussion", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Reply Discussion Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ReplyDiscussionCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.DiscussionDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussions/reports/{reportID}": { "get": { "description": "Gets a discussion report by its ID", "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Gets a discussion report by ID", "parameters": [ { "type": "string", "description": "Report ID", "name": "reportID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/reports.DiscussionReportDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussions/roots": { "post": { "description": "Create a new root-level discussion, meaning a discussion that is not a reply.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Create new root discussion", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Root Discussion Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.RootDiscussionCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.DiscussionDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussions/{discussionID}": { "get": { "description": "Get a discussion by discussion ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Get discussion", "parameters": [ { "type": "string", "description": "Discussion ID", "name": "discussionID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.DiscussionDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "delete": { "description": "Delete a discussion with given ID from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Delete a discussion", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "discussion ID", "name": "discussionID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/discussions/{discussionID}/reports": { "get": { "description": "Get all reports that have been added to this discussion", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Get all reports of this discussion", "parameters": [ { "type": "string", "description": "Discussion ID", "name": "discussionID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "post": { "description": "Create a new report for a discussion", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "discussions" ], "summary": "Add a new report to a discussion", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Report Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ReportCreationForm" } }, { "type": "string", "description": "Discussion ID", "name": "discussionID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ReportDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/filter/posts": { "get": { "description": "Returns all post IDs that meet the requirements in the form\nEndpoint is offset-paginated", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "filtering" ], "summary": "Filters all posts", "parameters": [ { "type": "integer", "description": "page query", "name": "page", "in": "query" }, { "type": "integer", "description": "page size", "name": "size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members": { "get": { "description": "Get the ID of every member in the database.", "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get IDs of all members", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.MemberShortFormDTO" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "post": { "description": "Create a new member from the given fields.\nThe member must have a unique email address, which isn't associated with any other accounts.\nThey are automatically logged in, and an access + refresh token pair is returned alongside the member.\nThe access-token is valid for 15 minutes and the refresh token is valid for 3 days.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Create a new member", "parameters": [ { "description": "Member Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.MemberCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.MemberDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/login": { "post": { "description": "Logs a member in based on email and password and returns an access and refresh token.\nThe access-token is valid for 15 minutes and the refresh token is valid for 3 days.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Logs a member in", "parameters": [ { "description": "Member Authentication Form", "name": "member", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.MemberAuthForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.LoggedInMemberDTO" } }, "400": { "description": "Bad Request" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error" } } } }, "/members/token": { "post": { "description": "Refreshes the access token with a refresh token.\nThe access-token is valid for 15 minutes and the refresh token is valid for 3 days.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Refreshes the access token.", "parameters": [ { "description": "Token Refresh Form", "name": "member", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.TokenRefreshForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.TokenPairDTO" } }, "400": { "description": "Bad Request" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error" } } } }, "/members/{memberID}": { "get": { "description": "Get a member by member ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get member from database", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.MemberDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "delete": { "description": "Delete a member with given ID from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Delete a member", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/branches": { "get": { "description": "Get all branches that this member is a collaborator of", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all branches of this member", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/discussions": { "get": { "description": "Get all discussions that this member has participated in", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all discussions", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/posts": { "get": { "description": "Get all posts that this member is a collaborator of", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all posts of this member", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/project-posts": { "get": { "description": "Get all project posts that this member is a collaborator of", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all project posts of this member", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/saved-posts": { "get": { "description": "Get all posts that this member has saved", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all saved posts of this member", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/saved-posts/{postID}": { "post": { "description": "Adds a post to the saved posts of a member", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Adds new saved post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true }, { "type": "string", "description": "post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/saved-project-posts": { "get": { "description": "Get all project posts that this member has saved", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Get all saved project posts of this member", "parameters": [ { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/members/{memberID}/saved-project-posts/{postID}": { "post": { "description": "Adds a project post to the saved project posts of a member", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "members" ], "summary": "Adds new saved project post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "member ID", "name": "memberID", "in": "path", "required": true }, { "type": "string", "description": "post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts": { "post": { "description": "Create a new question or discussion post. Cannot be a project post.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Create new post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Post Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.PostCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/collaborators/all/{postID}": { "get": { "description": "Returns all post collaborators of the post with the given ID", "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get all post collaborators of a post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.PostCollaboratorDTO" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/collaborators/{collaboratorID}": { "get": { "description": "Get a post collaborator by ID, a member who has collaborated on a post", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get a post collaborator by ID", "parameters": [ { "type": "string", "description": "Collaborator ID", "name": "collaboratorID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PostCollaboratorDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/from-github": { "post": { "description": "Create a new question or discussion post\nCreates a post in the same way as CreatePost\nHowever, the post files are imported from the given Github repository", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Create new post with the version imported from github", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Post Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.PostCreationForm" } }, { "type": "string", "description": "Github repository url", "name": "url", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/reports/{reportID}": { "get": { "description": "Gets a post report by its ID", "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Gets a post report by ID", "parameters": [ { "type": "string", "description": "Report ID", "name": "reportID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/reports.PostReportDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}": { "get": { "description": "Get a post by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get post by ID", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.PostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "delete": { "description": "Delete a post with given ID from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Delete a post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/file/{filepath}": { "get": { "description": "Get the contents of a single file from the main version of a post", "produces": [ "application/octet-stream" ], "tags": [ "posts" ], "summary": "Get a file from a post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true }, { "type": "string", "description": "Filepath", "name": "filepath", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/project-post": { "get": { "description": "Get the Project Post ID that encapsulates a Post, if this Project Post exists", "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get Project Post of Post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "integer" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/render": { "get": { "description": "Get the main render of the repository underlying a post if it exists and has been rendered successfully", "produces": [ "text/html" ], "tags": [ "posts" ], "summary": "Get the main render of a post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "202": { "description": "Accepted", "schema": { "type": "array", "items": { "type": "integer" } } }, "204": { "description": "No Content", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/reports": { "get": { "description": "Get all reports that have been added to this post", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get all reports of this post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "post": { "description": "Create a new report for a post", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Add a new report to a post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Report Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ReportCreationForm" } }, { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ReportDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/repository": { "get": { "description": "Get the entire zipped main repository of a post", "produces": [ "application/zip" ], "tags": [ "posts" ], "summary": "Get the main repository of a post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/tree": { "get": { "description": "Get the filetree of a the main version of a post, together with the size of the file in bytes.\nDirectories have a size of -1.", "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get the filetree of a post", "parameters": [ { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "integer" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/posts/{postID}/upload": { "post": { "description": "Upload a zipped quarto project to a post. This is the main version of the post, as there are no other versions.\nSpecifically, this zip should contain all of the contents of the project at its root, not in a subdirectory.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Upload a new project version to a branch", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "Post ID", "name": "postID", "in": "path", "required": true }, { "type": "file", "description": "Repository to create", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/project-posts": { "post": { "description": "Create a new project post with a single open branch. Upload to this branch in order to have your post reviewed.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Create new project post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Project Post Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ProjectPostCreationForm" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ProjectPostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/project-posts/from-github": { "post": { "description": "Create a new project post\nCreates a project post in the same way as CreateProjectPost\nHowever, the post files are imported from the given Github repository", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Create new project post with the version imported from github", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "description": "Post Creation Form", "name": "form", "in": "body", "required": true, "schema": { "$ref": "#/definitions/forms.ProjectPostCreationForm" } }, { "type": "string", "description": "Github repository url", "name": "url", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ProjectPostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/project-posts/{projectPostID}": { "get": { "description": "Get a project post by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Get project post", "parameters": [ { "type": "string", "description": "Post ID", "name": "projectPostID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ProjectPostDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } }, "delete": { "description": "Delete a project post with given ID from database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Delete a project post", "parameters": [ { "type": "string", "description": "Access Token", "name": "Authorization", "in": "header", "required": true }, { "type": "string", "description": "post ID", "name": "projectPostID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/project-posts/{projectPostID}/all-discussion-containers": { "get": { "description": "Returns all discussion container IDs on this project post over all its previous merged versions, instead of only the current version", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Returns all discussion container IDs associated with the project post", "parameters": [ { "type": "string", "description": "project post ID", "name": "projectPostID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.DiscussionContainerProjectHistoryDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/project-posts/{projectPostID}/branches-by-status": { "get": { "description": "Returns all branch IDs of this project post, grouped by each branch's review status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project-posts" ], "summary": "Get branch IDs by review status", "parameters": [ { "type": "string", "description": "project post ID", "name": "projectPostID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.BranchesGroupedByReviewStatusDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/tags/completion-status": { "get": { "description": "Returns every possible completion status that a Post can have", "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Returns all completion statuses", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.ProjectCompletionStatus" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/tags/feedback-preference": { "get": { "description": "Returns every possible feedback preference that a Project Post can have", "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Returns all feedback preferences", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.ProjectFeedbackPreference" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/tags/post-type": { "get": { "description": "Returns every possible post type that a Post can have", "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Returns all post types", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.PostType" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/tags/scientific": { "get": { "description": "Returns all scientific tags in the database", "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Returns all scientific tags", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.ScientificFieldTagDTO" } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } }, "/tags/scientific/containers/{containerID}": { "get": { "description": "Get a scientific tag container by its ID, to access its scientific tags", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Get scientific tag container", "parameters": [ { "type": "string", "description": "scientific tag container ID", "name": "containerID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ScientificFieldTagContainerDTO" } }, "400": { "description": "Bad Request" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error" } } } }, "/tags/scientific/{tagID}": { "get": { "description": "Get a scientific field tag by tag ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tags" ], "summary": "Get scientific field tag from database", "parameters": [ { "type": "string", "description": "tag ID", "name": "tagID", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.ScientificFieldTagDTO" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.HTTPError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.HTTPError" } } } } } }, "definitions": { "forms.BranchCreationForm": { "type": "object", "properties": { "anonymous": { "type": "boolean", "example": false }, "branchTitle": { "type": "string", "example": "Proposed Changes" }, "collaboratingMemberIDs": { "description": "The branch's metadata", "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "projectPostID": { "type": "integer", "example": 1 }, "updatedCompletionStatus": { "allOf": [ { "$ref": "#/definitions/models.ProjectCompletionStatus" } ], "example": "completed" }, "updatedFeedbackPreferences": { "allOf": [ { "$ref": "#/definitions/models.ProjectFeedbackPreference" } ], "example": "formal feedback" }, "updatedPostTitle": { "description": "Changes made by the branch", "type": "string", "example": "Updated Project Post Title" }, "updatedScientificFieldIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] } } }, "forms.DiscussionCreationForm": { "type": "object", "properties": { "anonymous": { "description": "If anonymous, the discussion will ignore member ID", "type": "boolean", "example": false }, "text": { "type": "string", "example": "Discussion content." } } }, "forms.MemberAuthForm": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "forms.MemberCreationForm": { "type": "object", "properties": { "email": { "type": "string", "example": "example@example.example" }, "firstName": { "type": "string", "example": "John" }, "institution": { "type": "string", "example": "Example University" }, "lastName": { "type": "string", "example": "Doe" }, "password": { "description": "making the password just a string for now\nTODO: some hashing or semblance of security", "type": "string", "example": "password" }, "scientificFieldTagIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] } } }, "forms.PostCreationForm": { "type": "object", "properties": { "anonymous": { "type": "boolean", "example": false }, "authorMemberIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "postType": { "allOf": [ { "$ref": "#/definitions/models.PostType" } ], "example": "question" }, "scientificFieldTagIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "title": { "type": "string", "example": "Post Title" } } }, "forms.ProjectPostCreationForm": { "type": "object", "properties": { "anonymous": { "type": "boolean", "example": false }, "authorMemberIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "projectCompletionStatus": { "allOf": [ { "$ref": "#/definitions/models.ProjectCompletionStatus" } ], "example": "ongoing" }, "projectFeedbackPreference": { "allOf": [ { "$ref": "#/definitions/models.ProjectFeedbackPreference" } ], "example": "formal feedback" }, "scientificFieldTagIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "title": { "type": "string", "example": "Project Post Title" } } }, "forms.ReplyDiscussionCreationForm": { "type": "object", "properties": { "discussion": { "$ref": "#/definitions/forms.DiscussionCreationForm" }, "parentID": { "description": "The Discussion this Discussion will be added to", "type": "integer", "example": 1 } } }, "forms.ReportCreationForm": { "type": "object" }, "forms.ReviewCreationForm": { "type": "object", "properties": { "branchID": { "type": "integer", "example": 1 }, "branchReviewDecision": { "allOf": [ { "$ref": "#/definitions/models.BranchReviewDecision" } ], "example": "approved" }, "feedback": { "type": "string", "example": "Fantastic work!" } } }, "forms.RootDiscussionCreationForm": { "type": "object", "properties": { "containerID": { "description": "The DiscussionContainer this Discussion will be added to", "type": "integer", "example": 1 }, "discussion": { "$ref": "#/definitions/forms.DiscussionCreationForm" } } }, "forms.TokenRefreshForm": { "type": "object", "properties": { "refreshToken": { "type": "string" } } }, "models.BranchCollaboratorDTO": { "type": "object", "properties": { "branchID": { "type": "integer", "example": 1 }, "id": { "type": "integer", "example": 1 }, "memberID": { "type": "integer", "example": 1 } } }, "models.BranchDTO": { "type": "object", "properties": { "branchOverallReviewStatus": { "allOf": [ { "$ref": "#/definitions/models.BranchOverallReviewStatus" } ], "example": "open for review" }, "branchTitle": { "type": "string", "example": "Proposed Changes" }, "collaboratorIDs": { "description": "MR metadata", "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "createdAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "discussionContainerID": { "type": "integer", "example": 1 }, "id": { "type": "integer", "example": 1 }, "projectPostID": { "type": "integer", "example": 1 }, "renderStatus": { "allOf": [ { "$ref": "#/definitions/models.RenderStatus" } ], "example": "pending" }, "reviewIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "updatedAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "updatedCompletionStatus": { "allOf": [ { "$ref": "#/definitions/models.ProjectCompletionStatus" } ], "example": "ongoing" }, "updatedFeedbackPreferences": { "allOf": [ { "$ref": "#/definitions/models.ProjectFeedbackPreference" } ], "example": "formal feedback" }, "updatedPostTitle": { "description": "MR's proposed changes", "type": "string", "example": "Updated Project Post Title" }, "updatedScientificFieldTagContainerID": { "type": "integer", "example": 1 } } }, "models.BranchOverallReviewStatus": { "type": "string", "enum": [ "open for review", "peer reviewed", "rejected" ], "x-enum-varnames": [ "BranchOpenForReview", "BranchPeerReviewed", "BranchRejected" ] }, "models.BranchReviewDTO": { "type": "object", "properties": { "branchID": { "type": "integer", "example": 1 }, "branchReviewDecision": { "allOf": [ { "$ref": "#/definitions/models.BranchReviewDecision" } ], "example": "approved" }, "createdAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "feedback": { "type": "string", "example": "Fantastic work!" }, "id": { "type": "integer", "example": 1 }, "memberID": { "type": "integer", "example": 1 } } }, "models.BranchReviewDecision": { "type": "string", "enum": [ "rejected", "approved" ], "x-enum-varnames": [ "Rejected", "Approved" ] }, "models.BranchesGroupedByReviewStatusDTO": { "type": "object", "properties": { "approvedClosedBranchIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 3 ] }, "openBranchIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "rejectedClosedBranchIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 2 ] } } }, "models.ClosedBranchDTO": { "type": "object", "properties": { "branchID": { "type": "integer", "example": 1 }, "branchReviewDecision": { "allOf": [ { "$ref": "#/definitions/models.BranchReviewDecision" } ], "example": "approved" }, "id": { "type": "integer", "example": 1 }, "projectPostID": { "type": "integer", "example": 1 }, "supercededBranchID": { "type": "integer", "example": 2 } } }, "models.CollaborationType": { "type": "string", "enum": [ "author", "contributor", "reviewer" ], "x-enum-varnames": [ "Author", "Contributor", "Reviewer" ] }, "models.DiscussionContainerDTO": { "type": "object", "properties": { "discussionIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "id": { "type": "integer", "example": 1 } } }, "models.DiscussionContainerProjectHistoryDTO": { "type": "object", "properties": { "currentDiscussionContainerID": { "type": "integer", "example": 1 }, "mergedBranchDiscussionContainers": { "type": "array", "items": { "$ref": "#/definitions/models.DiscussionContainerWithBranchDTO" } } } }, "models.DiscussionContainerWithBranchDTO": { "type": "object", "properties": { "closedBranchID": { "type": "integer", "example": 1 }, "discussionContainerID": { "type": "integer", "example": 2 } } }, "models.DiscussionDTO": { "type": "object", "properties": { "createdAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "id": { "type": "integer", "example": 1 }, "memberID": { "type": "integer", "example": 1 }, "replyIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 2 ] }, "text": { "type": "string", "example": "Discussion content." } } }, "models.LoggedInMemberDTO": { "type": "object", "properties": { "accessExp": { "type": "integer" }, "accessToken": { "type": "string" }, "member": { "$ref": "#/definitions/models.MemberDTO" }, "refreshExp": { "type": "integer" }, "refreshToken": { "type": "string" } } }, "models.MemberDTO": { "type": "object", "properties": { "email": { "type": "string", "example": "example@example.example" }, "firstName": { "type": "string", "example": "John" }, "id": { "type": "integer", "example": 1 }, "institution": { "type": "string", "example": "Example University" }, "lastName": { "type": "string", "example": "Doe" }, "scientificFieldTagContainerID": { "type": "integer", "example": 1 } } }, "models.MemberShortFormDTO": { "type": "object", "properties": { "firstName": { "type": "string", "example": "John" }, "id": { "type": "integer", "example": 1 }, "lastName": { "type": "string", "example": "Doe" } } }, "models.PostCollaboratorDTO": { "type": "object", "properties": { "collaborationType": { "allOf": [ { "$ref": "#/definitions/models.CollaborationType" } ], "example": "author" }, "id": { "type": "integer", "example": 1 }, "memberID": { "type": "integer", "example": 1 }, "postID": { "type": "integer", "example": 1 } } }, "models.PostDTO": { "type": "object", "properties": { "collaboratorIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "createdAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "discussionContainerID": { "type": "integer", "example": 1 }, "id": { "type": "integer", "example": 1 }, "postType": { "allOf": [ { "$ref": "#/definitions/models.PostType" } ], "example": "question" }, "renderStatus": { "allOf": [ { "$ref": "#/definitions/models.RenderStatus" } ], "example": "success" }, "scientificFieldTagContainerID": { "type": "integer", "example": 1 }, "title": { "type": "string", "example": "Post Title" }, "updatedAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" } } }, "models.PostType": { "type": "string", "enum": [ "project", "question", "reflection" ], "x-enum-varnames": [ "Project", "Question", "Reflection" ] }, "models.ProjectCompletionStatus": { "type": "string", "enum": [ "idea", "ongoing", "completed" ], "x-enum-varnames": [ "Idea", "Ongoing", "Completed" ] }, "models.ProjectFeedbackPreference": { "type": "string", "enum": [ "discussion feedback", "formal feedback" ], "x-enum-varnames": [ "DiscussionFeedback", "FormalFeedback" ] }, "models.ProjectPostDTO": { "type": "object", "properties": { "closedBranchIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "createdAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" }, "id": { "type": "integer", "example": 1 }, "openBranchIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] }, "postID": { "type": "integer", "example": 1 }, "postReviewStatus": { "allOf": [ { "$ref": "#/definitions/models.ProjectReviewStatus" } ], "example": "open" }, "projectCompletionStatus": { "allOf": [ { "$ref": "#/definitions/models.ProjectCompletionStatus" } ], "example": "ongoing" }, "projectFeedbackPreference": { "allOf": [ { "$ref": "#/definitions/models.ProjectFeedbackPreference" } ], "example": "formal feedback" }, "updatedAt": { "type": "string", "example": "2024-06-16T16:00:43.234Z" } } }, "models.ProjectReviewStatus": { "type": "string", "enum": [ "open", "revision needed", "reviewed" ], "x-enum-varnames": [ "Open", "RevisionNeeded", "Reviewed" ] }, "models.RenderStatus": { "type": "string", "enum": [ "success", "pending", "failure" ], "x-enum-varnames": [ "Success", "Pending", "Failure" ] }, "models.ReportDTO": { "type": "object" }, "models.ScientificFieldTagContainerDTO": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "scientificFieldTagIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 1 ] } } }, "models.ScientificFieldTagDTO": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "parentID": { "type": "integer", "example": 3 }, "scientificField": { "type": "string", "example": "linear algebra" }, "subtagIDs": { "type": "array", "items": { "type": "integer" }, "example": [ 2 ] } } }, "models.TokenPairDTO": { "type": "object", "properties": { "accessExp": { "type": "integer" }, "accessToken": { "type": "string" }, "refreshExp": { "type": "integer" }, "refreshToken": { "type": "string" } } }, "reports.DiscussionReportDTO": { "type": "object", "properties": { "discussionID": { "type": "integer", "example": 1 } } }, "reports.PostReportDTO": { "type": "object", "properties": { "postID": { "type": "integer", "example": 1 } } }, "utils.HTTPError": { "type": "object", "properties": { "error": { "type": "string", "example": "failed to something: reason" } } } } }