{ "openapi": "3.0.0", "paths": { "/auth/register": { "post": { "operationId": "AuthController_register", "parameters": [], "requestBody": { "required": true, "description": "User registration data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterDto" } } } }, "responses": { "201": { "description": "User registered successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Email already in use" } }, "summary": "Register a new user", "tags": [ "Auth" ] } }, "/auth/login": { "post": { "operationId": "AuthController_login", "parameters": [], "requestBody": { "required": true, "description": "User login credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginDto" } } } }, "responses": { "200": { "description": "Login successful", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Invalid credentials" } }, "summary": "Log in a user", "tags": [ "Auth" ] } }, "/auth/refresh": { "post": { "operationId": "AuthController_refresh", "parameters": [], "responses": { "200": { "description": "Token refreshed successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Access Denied" } }, "security": [ { "bearer": [] } ], "summary": "Refresh JWT token", "tags": [ "Auth" ] } }, "/auth/logout": { "post": { "operationId": "AuthController_logout", "parameters": [ { "name": "userId", "required": true, "in": "query", "description": "User ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Logout successful" } }, "security": [ { "bearer": [] } ], "summary": "Log out a user", "tags": [ "Auth" ] } }, "/auth/password-reset": { "post": { "operationId": "AuthController_sendPasswordResetToken", "parameters": [], "requestBody": { "required": true, "description": "Email for password reset", "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" } } } } } }, "responses": { "200": { "description": "Reset link sent if email exists" } }, "summary": "Request password reset", "tags": [ "Auth" ] } }, "/auth/password-reset/confirm": { "post": { "operationId": "AuthController_resetPassword", "parameters": [], "responses": { "200": { "description": "Password reset successfully" }, "400": { "description": "Token is invalid or expired" } }, "summary": "Reset password with token", "tags": [ "Auth" ] } }, "/user/profile": { "get": { "operationId": "UserController_getProfile", "parameters": [], "responses": { "200": { "description": "" } }, "security": [ { "bearer": [] } ], "summary": "Get user profile", "tags": [ "User" ] }, "patch": { "operationId": "UserController_updateProfile", "parameters": [], "requestBody": { "required": true, "description": "Data to update user profile", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateProfileDto" } } } }, "responses": { "200": { "description": "Profile updated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "profile updated" } } } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "bearer": [] } ], "summary": "Update user profile", "tags": [ "User" ] } }, "/courses": { "get": { "operationId": "CoursesController_findAll", "parameters": [ { "name": "tags", "required": true, "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Course" } } } } } }, "summary": "Get all courses", "tags": [ "courses" ] } }, "/courses/{id}": { "get": { "operationId": "CoursesController_findOne", "parameters": [ { "name": "id", "required": true, "in": "path", "schema": { "type": "number" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Course" } } } } }, "summary": "Get course by ID", "tags": [ "courses" ] } } }, "info": { "title": "API Documentation", "description": "API description for your NestJS application", "version": "1.0", "contact": {} }, "tags": [], "servers": [], "components": { "securitySchemes": { "bearer": { "scheme": "bearer", "bearerFormat": "JWT", "type": "http" } }, "schemas": { "RegisterDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email", "example": "user@example.com" }, "password": { "type": "string", "description": "User password", "example": "password123" } }, "required": [ "email", "password" ] }, "LoginDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email", "example": "user@example.com" }, "password": { "type": "string", "description": "User password", "example": "password123" } }, "required": [ "email", "password" ] }, "UpdateProfileDto": { "type": "object", "properties": { "name": { "type": "string", "example": "John", "description": "User name" }, "surname": { "type": "string", "example": "Doe", "description": "User surname" }, "phone": { "type": "string", "example": "+1234567890", "description": "User phone" }, "city": { "type": "string", "example": "New York", "description": "User city" }, "country": { "type": "string", "example": "USA", "description": "User country" } } }, "Course": { "type": "object", "properties": {} } } } }