{ "swagger": "2.0", "info": { "description": "API Server for Course Platform", "title": "Course Platform API", "contact": {}, "version": "1.0" }, "host": "localhost:8000", "basePath": "/api/v1/", "paths": { "/students/courses": { "get": { "security": [ { "StudentsAuth": [] } ], "description": "student get all courses", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student Get All Courses", "operationId": "studentGetAllCourses", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.Course" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } }, "/students/courses/{id}": { "get": { "security": [ { "StudentsAuth": [] } ], "description": "student get course by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student Get Course By ID", "operationId": "studentGetCourseById", "parameters": [ { "type": "string", "description": "course id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.Course" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } }, "/students/refresh": { "post": { "security": [ { "StudentsAuth": [] } ], "description": "student refresh tokens", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student Refresh Tokens", "operationId": "studentRefresh", "parameters": [ { "description": "sign up info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.refreshInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.tokenResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } }, "/students/sign-in": { "post": { "description": "student sign in", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student SignIn", "operationId": "studentSignIn", "parameters": [ { "description": "sign up info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.studentSignInInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.tokenResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } }, "/students/sign-up": { "post": { "description": "create student account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student SignUp", "operationId": "studentSignUp", "parameters": [ { "description": "sign up info", "name": "input", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.studentSignUpInput" } } ], "responses": { "201": { "description": "ok", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } }, "/students/verify/{code}": { "post": { "description": "student verify registration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "students" ], "summary": "Student Verify Registration", "operationId": "studentVerify", "parameters": [ { "type": "string", "description": "verification code", "name": "code", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.tokenResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "404": { "description": "Bad Request", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/v1.errorResponse" } }, "default": { "description": "", "schema": { "$ref": "#/definitions/v1.errorResponse" } } } } } }, "definitions": { "domain.Course": { "type": "object", "properties": { "code": { "type": "string" }, "createdAt": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "imageUrl": { "type": "string" }, "name": { "type": "string" }, "published": { "type": "boolean" }, "updatedAt": { "type": "string" } } }, "v1.errorResponse": { "type": "object", "properties": { "message": { "type": "string" } } }, "v1.refreshInput": { "type": "object", "required": [ "token" ], "properties": { "token": { "type": "string" } } }, "v1.studentSignInInput": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "v1.studentSignUpInput": { "type": "object", "required": [ "email", "name", "password" ], "properties": { "email": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" }, "registerSource": { "type": "string" } } }, "v1.tokenResponse": { "type": "object", "properties": { "accessToken": { "type": "string" }, "refreshToken": { "type": "string" } } } }, "securityDefinitions": { "AdminAuth": { "type": "apiKey", "name": "Authorization", "in": "header" }, "StudentsAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }