{ "swagger": "2.0", "info": { "description": "Api Documentation", "version": "1.1", "title": "Api Documentation", "termsOfService": "urn:tos", "contact": {}, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, "host": "localhost:8080", "basePath": "/", "tags": [ { "name": "health-controller", "description": "Health Controller" }, { "name": "leet-code-controller", "description": "Leet Code Controller" } ], "paths": { "/api/v1/leetcode/questions": { "get": { "tags": [ "leet-code-controller" ], "summary": "getQuestions", "operationId": "getQuestionsUsingGET", "produces": [ "*/*" ], "responses": { "200": { "description": "Get all LeetCode questions", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/category/{category}": { "get": { "tags": [ "leet-code-controller" ], "summary": "getQuestionsByCategory", "operationId": "getQuestionsByCategoryUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "category", "in": "path", "description": "category of the questions", "required": true, "type": "string", "x-example": "array", "enum": [ "algorithms", "all", "concurrency", "database", "shell" ] } ], "responses": { "200": { "description": "Get LeetCode questions by category", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/category/{category}/difficulty/{difficulty}": { "get": { "tags": [ "leet-code-controller" ], "summary": "getQuestionsByCategoryAndDifficulty", "operationId": "getQuestionsByCategoryAndDifficultyUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "category", "in": "path", "description": "category of the questions", "required": true, "type": "string", "x-example": "array", "enum": [ "algorithms", "all", "concurrency", "database", "shell" ] }, { "name": "difficulty", "in": "path", "description": "difficulty of the questions", "required": true, "type": "string", "x-example": "hard", "enum": [ "all", "easy", "hard", "medium" ] } ], "responses": { "200": { "description": "Get LeetCode questions by category and difficulty", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/category/{category}/difficulty/{difficulty}/random": { "get": { "tags": [ "leet-code-controller" ], "summary": "getRandomQuestionByCategoryAndDifficulty", "operationId": "getRandomQuestionByCategoryAndDifficultyUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "category", "in": "path", "description": "category of the questions", "required": true, "type": "string", "x-example": "array", "enum": [ "algorithms", "all", "concurrency", "database", "shell" ] }, { "name": "difficulty", "in": "path", "description": "difficulty of the questions", "required": true, "type": "string", "x-example": "hard", "enum": [ "all", "easy", "hard", "medium" ] } ], "responses": { "200": { "description": "Get a random Leetcode question by category and difficulty", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/category/{category}/random": { "get": { "tags": [ "leet-code-controller" ], "summary": "getRandomQuestionByCategory", "operationId": "getRandomQuestionByCategoryUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "category", "in": "path", "description": "category of the questions", "required": true, "type": "string", "x-example": "array", "enum": [ "algorithms", "all", "concurrency", "database", "shell" ] } ], "responses": { "200": { "description": "Get a random Leetcode question by category", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/difficulty/{difficulty}": { "get": { "tags": [ "leet-code-controller" ], "summary": "getQuestionsByDifficulty", "operationId": "getQuestionsByDifficultyUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "difficulty", "in": "path", "description": "difficulty of the questions", "required": true, "type": "string", "x-example": "hard", "enum": [ "all", "easy", "hard", "medium" ] } ], "responses": { "200": { "description": "Get LeetCode questions by difficulty", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/difficulty/{difficulty}/random": { "get": { "tags": [ "leet-code-controller" ], "summary": "getRandomQuestionByDifficulty", "operationId": "getRandomQuestionByDifficultyUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "difficulty", "in": "path", "description": "difficulty of the questions", "required": true, "type": "string", "x-example": "hard", "enum": [ "all", "easy", "hard", "medium" ] } ], "responses": { "200": { "description": "Get a random Leetcode question by difficulty", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/random": { "get": { "tags": [ "leet-code-controller" ], "summary": "getRandomQuestion", "operationId": "getRandomQuestionUsingGET", "produces": [ "*/*" ], "responses": { "200": { "description": "Get random LeetCode question", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/submissions/{id}": { "get": { "tags": [ "leet-code-controller" ], "summary": "submit", "operationId": "submitUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "id", "in": "path", "description": "id", "required": true, "type": "string" }, { "name": "Session", "in": "header", "description": "LEETCODE_SESSION cookie", "required": false, "type": "string" }, { "name": "X-CSRF-Token", "in": "header", "description": "X-CSRF-Token cookie", "required": false, "type": "string" } ], "responses": { "200": { "description": "Get LeetCode question submission details", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/{name}": { "get": { "tags": [ "leet-code-controller" ], "summary": "getQuestionById", "operationId": "getQuestionByIdUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "path", "description": "name / title-slug of the question", "required": true, "type": "string", "x-example": "two-sum" } ], "responses": { "200": { "description": "Get LeetCode question by name", "schema": { "type": "object" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/api/v1/leetcode/questions/{name}/submit": { "post": { "tags": [ "leet-code-controller" ], "summary": "submit", "operationId": "submitUsingPOST", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "path", "description": "name - title slug of the question name", "required": true, "type": "string", "x-example": "two-sum" }, { "name": "Session", "in": "header", "description": "LEETCODE_SESSION cookie", "required": false, "type": "string" }, { "in": "body", "name": "submissionBody", "description": "submissionBody", "required": true, "schema": { "$ref": "#/definitions/SubmissionBody" } }, { "name": "X-CSRF-Token", "in": "header", "description": "X-CSRF-Token cookie", "required": false, "type": "string" } ], "responses": { "200": { "description": "Submit LeetCode question answer", "schema": { "type": "object" } }, "201": { "description": "Created" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/health": { "get": { "tags": [ "health-controller" ], "summary": "health", "operationId": "healthUsingGET", "produces": [ "*/*" ], "responses": { "200": { "description": "Health check", "schema": { "type": "string" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } } }, "definitions": { "SubmissionBody": { "type": "object", "properties": { "lang": { "type": "string" }, "question_id": { "type": "integer", "format": "int32" }, "typed_code": { "type": "string" } }, "title": "SubmissionBody" } } }