{ "swagger": "2.0", "info": { "description": "This is an auto-generated API Docs.", "title": "API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "email": "your@mail.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "paths": { "/add-issue-dependency/{issue_id}/{dependent_issue_id}": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds assocation with issue and dependent issue", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Issues" ], "summary": "Adds assocation with issue and dependent issue", "parameters": [ { "type": "string", "description": "Issue ID", "name": "issue_id", "in": "path", "required": true }, { "type": "string", "description": "Dependent Issue ID", "name": "dependent_issue_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Issue" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/helper.EmptyObj" } } } } ] } } } } }, "/api/auth/login": { "post": { "description": "Login", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login", "parameters": [ { "description": "loginRequest", "name": "Auth", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.User" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/helper.EmptyObj" } } } ] } } } } }, "/api/auth/register": { "post": { "description": "Regişter", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Register", "parameters": [ { "description": "registerRequest", "name": "Auth", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.RegisterRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.User" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/helper.EmptyObj" } } } ] } } } } }, "/api/issue": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "GetIssues is a function to get all issues data from database with dynamic query parameters", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Issues" ], "summary": "Get all issues with query parameters", "parameters": [ { "type": "integer", "name": "assignieID", "in": "query" }, { "type": "boolean", "name": "getOnlyOrphans", "in": "query" }, { "type": "integer", "name": "parentIssueID", "in": "query" }, { "type": "integer", "name": "projectID", "in": "query" }, { "type": "integer", "name": "reporterID", "in": "query" }, { "type": "integer", "name": "status", "in": "query" }, { "type": "integer", "name": "subjectID", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/response.IssueResponse" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/helper.EmptyObj" } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Creates new issue", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Issues" ], "summary": "Create new Issue", "parameters": [ { "description": "createIssues", "name": "Issue", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.IssueCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Issue" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/helper.EmptyObj" } } } ] } } } } }, "/api/issue-comment": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Creates new IssueComment", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "IssueComments" ], "summary": "Create new IssueComment", "parameters": [ { "description": "createIssues", "name": "Issue", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.IssueCommentCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.IssueComment" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/helper.EmptyObj" } } } ] } } } } }, "/api/issue/kanban": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all issues as Kanban Format with query parameters", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Issues" ], "summary": "Get all issues as Kanban Format with query parameters", "parameters": [ { "type": "integer", "name": "assignieID", "in": "query" }, { "type": "boolean", "name": "getOnlyOrphans", "in": "query" }, { "type": "integer", "name": "parentIssueID", "in": "query" }, { "type": "integer", "name": "projectID", "in": "query" }, { "type": "integer", "name": "reporterID", "in": "query" }, { "type": "integer", "name": "status", "in": "query" }, { "type": "integer", "name": "subjectID", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/response.IssueKanbanResponse" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/helper.EmptyObj" } } } } ] } } } } }, "/api/project": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds new project to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "summary": "Insert Project", "parameters": [ { "description": "Create Project", "name": "Project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.ProjectCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Project" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helper.Response" } } } } }, "/api/project/sidenav-options/{user_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns projects that the user is a member of, with subjects", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "summary": "Returns projects that the user is a member of, with subjects", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.ProjectNavTreeResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/helper.EmptyObj" } } } } ] } } } } }, "/api/subject": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds new subject to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Subject" ], "summary": "Insert Subject", "parameters": [ { "description": "Create Subject", "name": "Subject", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.SubjectCreateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Subject" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helper.Response" } } } } }, "/api/subject/user-options/{subject_id}}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Gets subject user options by subject id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Subject" ], "summary": "Gets subject user options by subject id", "parameters": [ { "type": "string", "description": "Subject ID", "name": "subject_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.UserOptionResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helper.Response" } } } } }, "/api/subject/{subject_id}/{user_id}": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Creates subject - user many2many association", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Subject" ], "summary": "Creates subject - user many2many association", "parameters": [ { "type": "string", "description": "Subject ID", "name": "subject_id", "in": "path", "required": true }, { "type": "string", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Subject" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helper.Response" } } } } }, "/assignie-user/{issue_id}/{user_id}": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds assocation with issue and dependent issue", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Issues" ], "summary": "Adds assocation between issue and assigned user", "parameters": [ { "type": "string", "description": "Issue ID", "name": "issue_id", "in": "path", "required": true }, { "type": "string", "description": "Assignie User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Issue" } } } ] } }, "400": { "description": "Bad Request", "schema": { "allOf": [ { "$ref": "#/definitions/helper.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/helper.EmptyObj" } } } } ] } } } } }, "/v1/books": { "get": { "description": "Get all books", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "books" ], "summary": "Get all books", "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "503": { "description": "" } } } } }, "definitions": { "helper.EmptyObj": { "type": "object" }, "helper.Response": { "type": "object", "properties": { "data": {}, "errors": {}, "message": {} } }, "model.Issue": { "type": "object", "properties": { "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "issueForeignId": { "type": "string" }, "parentIssueID": { "type": "integer" }, "progress": { "type": "integer" }, "spendingTime": { "type": "integer" }, "status": { "type": "integer" }, "targetTime": { "type": "integer" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "model.IssueComment": { "type": "object", "properties": { "context": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "updatedAt": { "type": "string" } } }, "model.Project": { "type": "object", "properties": { "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "model.Subject": { "type": "object", "properties": { "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "repoId": { "type": "string" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "model.User": { "type": "object", "properties": { "createdAt": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "subjects": { "type": "array", "items": { "$ref": "#/definitions/model.Subject" } }, "token": { "type": "string" }, "updatedAt": { "type": "string" } } }, "request.IssueCommentCreateRequest": { "type": "object", "properties": { "context": { "type": "string" }, "issueID": { "type": "integer" } } }, "request.IssueCreateRequest": { "type": "object", "required": [ "description", "subjectID", "title" ], "properties": { "assignieID": { "type": "integer" }, "description": { "type": "string", "maxLength": 255 }, "issueForeignId": { "type": "string" }, "parentIssueID": { "type": "integer" }, "reporterID": { "type": "integer" }, "status": { "type": "integer" }, "subjectID": { "type": "integer" }, "targetTime": { "type": "integer" }, "title": { "type": "string", "maxLength": 32 } } }, "request.LoginRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "request.ProjectCreateRequest": { "type": "object", "required": [ "description", "title" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "title": { "type": "string", "maxLength": 32 } } }, "request.RegisterRequest": { "type": "object", "required": [ "email", "name", "password" ], "properties": { "email": { "type": "string" }, "name": { "type": "string", "maxLength": 32 }, "password": { "type": "string", "maxLength": 32, "minLength": 8 } } }, "request.SubjectCreateRequest": { "type": "object", "required": [ "description", "projectID", "title" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "projectID": { "type": "integer" }, "title": { "type": "string", "maxLength": 32 } } }, "response.IssueKanbanResponse": { "type": "object", "properties": { "issues": { "type": "array", "items": { "$ref": "#/definitions/response.IssueResponse" } }, "status": { "$ref": "#/definitions/response.StatusResponse" } } }, "response.IssueResponse": { "type": "object", "properties": { "assignieID": { "type": "integer" }, "createdAt": { "type": "string" }, "dependentIssues": { "type": "array", "items": { "$ref": "#/definitions/response.LeafIssueResponse" } }, "description": { "type": "string" }, "id": { "type": "integer" }, "issueForeignID": { "type": "string" }, "issues": { "description": "Comments []*IssueCommentResponse `gorm:\"foreignkey:IssueID;\" json:\"issueComments\"`", "type": "array", "items": { "$ref": "#/definitions/response.LeafIssueResponse" } }, "parentIssueID": { "type": "integer" }, "reporterID": { "type": "integer" }, "status": { "$ref": "#/definitions/response.StatusResponse" }, "statusID": { "type": "integer" }, "subjectID": { "type": "integer" }, "targetTime": { "type": "integer" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "response.LeafIssueResponse": { "type": "object", "properties": { "assignieID": { "type": "integer" }, "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "issueForeignID": { "type": "string" }, "parentIssueID": { "type": "integer" }, "reporterID": { "type": "integer" }, "status": { "$ref": "#/definitions/response.StatusResponse" }, "statusID": { "type": "integer" }, "subjectID": { "type": "integer" }, "targetTime": { "type": "integer" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "response.ProjectNavTreeResponse": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "subjects": { "type": "array", "items": { "$ref": "#/definitions/response.SubjectNavTreeResponse" } }, "title": { "type": "string" } } }, "response.StatusResponse": { "type": "object", "properties": { "hexCode": { "type": "string" }, "id": { "type": "integer" }, "title": { "type": "string" } } }, "response.SubjectNavTreeResponse": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "project_id": { "type": "integer" }, "title": { "type": "string" } } }, "response.UserOptionResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }