{ "openapi": "3.0.1", "info": { "title": "AaronCodeReview", "version": "v1" }, "servers": [ { "url": "https://aaron-code-review.aaronplugins.com" } ], "paths": { "/api/repo/code": { "post": { "summary": "Call this endpoint as soon as the user provides the github file URL.", "operationId": "getCode", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RepoInfoRequestBody" } } } }, "responses": { "200": { "description": "Code retrieved successfully", "content": { "text/plain": { "schema": { "type": "string", "example": "Sample code content here..." } } } } } } }, "/api/repo/commit": { "post": { "summary": "Call this endpoint when the user provides the link to the specific commit.", "operationId": "getCommitInfo", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RepoInfoRequestBody" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommitInfoBody" } } } }, "400": { "description": "Bad request. Either an invalid GitHub link or unable to retrieve commit information.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequestBody" } } } } } } }, "/api/repo/diffs": { "get": { "operationId": "Retrieves the current piece of diff of the git commit", "description": "Keep calling this endpoint unless you get the message that you've processed the last chunk", "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DiffsResponseBody" } } } } } } }, "/api/repo/getAllCommits": { "post": { "summary": "Call this endpoint when user want to know what was done by person on date in repo", "operationId": "WhatWasDoneByPerson", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WhatWasDoneBody" } } } }, "responses": { "200": { "description": "Commits got successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AllCommitsResponseBody" } } } } } } } }, "components": { "schemas": { "CommitInfoBody": { "type": "object", "properties": { "commitMessage": { "type": "string", "description": "Message of the commit." }, "commitAuthor": { "type": "string", "description": "Author of the commit." }, "commitDate": { "type": "string", "description": "Date of the commit." }, "files": { "type": "array", "items": { "type": "object", "properties": { "fileName": { "type": "string", "description": "Name of the file." }, "additions": { "type": "integer", "format": "int64", "description": "Number of lines added." }, "deletions": { "type": "integer", "format": "int64", "description": "Number of lines deleted." }, "changes": { "type": "integer", "format": "int64", "description": "Total number of changes (additions + deletions)." }, "fileStatus": { "type": "string", "description": "Status of the file (e.g., modified, added, deleted)." } } } }, "previousCommitSource": { "type": "string", "description": "Source of the previous commit." }, "responseInstructions": { "type": "string", "description": "Set of actions to do." } } }, "BadRequestBody": { "type": "object", "properties": { "message": { "type": "string", "description": "Error message." } } }, "RepoInfoRequestBody": { "type": "object", "properties": { "linkToRepo": { "type": "string", "description": "Direct link to the GitHub repository." }, "query": { "type": "string", "description": "Populate this field with the value of the query the user wants to execute on the code." } }, "required": [ "linkToRepo", "query" ] }, "WhatWasDoneBody": { "type": "object", "properties": { "personEmail": { "type": "string", "description": "Commits author email." }, "org": { "type": "string", "description": "Organization name." }, "repo": { "type": "string", "description": "Repository name." }, "dates": { "type": "array", "description": "The dates when the commits were created by the user.", "items": { "type": "string" } } }, "required": [ "personEmail", "org", "dates" ] }, "ResultRepos": { "type": "object", "properties": { "scopeOfWork": { "$ref": "#/components/schemas/ListResultRepo" } } }, "ListResultRepo": { "type": "array", "items": { "$ref": "#/components/schemas/ResultRepo" } }, "ResultRepo": { "type": "object", "properties": { "name": { "type": "string", "description": "Repository name." }, "commits": { "$ref": "#/components/schemas/ListResultCommit" } } }, "ListResultCommit": { "type": "array", "items": { "$ref": "#/components/schemas/ResultCommit" } }, "ResultCommit": { "type": "object", "properties": { "sha": { "type": "string", "description": "Commit sha." }, "date": { "type": "string", "description": "Date of commit." }, "message": { "type": "string", "description": "Commit message." } } }, "DiffsResponseBody": { "type": "object", "properties": { "lastChunk": { "type": "boolean", "description": "Boolean indicator that tell whether the last chunk was processed" }, "responseInstructions": { "type": "string", "description": "Set of actions to do" }, "diffsPart": { "type": "string", "description": "Part of the current diff" } } }, "AllCommitsResponseBody": { "type": "object", "properties": { "repos": { "$ref": "#/components/schemas/ResultRepos" }, "responseInstructions": { "type": "string", "description": "Instructions what you have to do with commits." } } } } } }