{ "openapi": "3.1.0", "info": { "title": "AI Personalized Learning Platform - Backend", "description": "TASK 3 Subtask 1 - Authentication + JWT", "version": "1.1.0" }, "paths": { "/api/v1/auth/register": { "post": { "tags": [ "Authentication" ], "summary": "Register", "operationId": "register_api_v1_auth_register_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "409": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/auth/login": { "post": { "tags": [ "Authentication" ], "summary": "Login", "operationId": "login_api_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/auth/refresh": { "post": { "tags": [ "Authentication" ], "summary": "Refresh", "operationId": "refresh_api_v1_auth_refresh_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/auth/me": { "get": { "tags": [ "Authentication" ], "summary": "Me", "operationId": "me_api_v1_auth_me_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/auth/logout": { "post": { "tags": [ "Authentication" ], "summary": "Logout", "operationId": "logout_api_v1_auth_logout_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/rbac/admin": { "get": { "tags": [ "RBAC" ], "summary": "Admin Resource", "operationId": "admin_resource_api_v1_rbac_admin_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/rbac/teacher": { "get": { "tags": [ "RBAC" ], "summary": "Teacher Resource", "operationId": "teacher_resource_api_v1_rbac_teacher_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/rbac/student": { "get": { "tags": [ "RBAC" ], "summary": "Student Resource", "operationId": "student_resource_api_v1_rbac_student_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/rbac/parent": { "get": { "tags": [ "RBAC" ], "summary": "Parent Resource", "operationId": "parent_resource_api_v1_rbac_parent_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Request rejected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/health": { "get": { "summary": "Health", "operationId": "health_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "LoginRequest": { "properties": { "email": { "type": "string", "format": "email", "title": "Email" }, "password": { "type": "string", "title": "Password" } }, "type": "object", "required": [ "email", "password" ], "title": "LoginRequest" }, "RefreshRequest": { "properties": { "refresh_token": { "type": "string", "minLength": 1, "title": "Refresh Token" } }, "type": "object", "required": [ "refresh_token" ], "title": "RefreshRequest" }, "RegisterRequest": { "properties": { "email": { "type": "string", "format": "email", "title": "Email" }, "full_name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Full Name" }, "password": { "type": "string", "maxLength": 128, "minLength": 8, "title": "Password" } }, "type": "object", "required": [ "email", "full_name", "password" ], "title": "RegisterRequest" }, "TokenResponse": { "properties": { "access_token": { "type": "string", "title": "Access Token" }, "refresh_token": { "type": "string", "title": "Refresh Token" }, "token_type": { "type": "string", "title": "Token Type", "default": "bearer" } }, "type": "object", "required": [ "access_token", "refresh_token" ], "title": "TokenResponse" }, "UserResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "email": { "type": "string", "format": "email", "title": "Email" }, "full_name": { "type": "string", "title": "Full Name" }, "role": { "$ref": "#/components/schemas/UserRole" }, "status": { "$ref": "#/components/schemas/UserStatus" } }, "type": "object", "required": [ "id", "email", "full_name", "role", "status" ], "title": "UserResponse" }, "UserRole": { "type": "string", "enum": [ "ADMIN", "TEACHER", "STUDENT", "PARENT" ], "title": "UserRole" }, "UserStatus": { "type": "string", "enum": [ "ACTIVE", "INACTIVE", "SUSPENDED" ], "title": "UserStatus" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "ErrorResponse": { "type": "object", "required": [ "detail" ], "properties": { "detail": { "type": "string" } }, "example": { "detail": "Invalid or expired access token" } } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } }, "servers": [ { "url": "http://localhost:8000", "description": "Local development server" } ] }