{ "openapi": "3.0.4", "info": { "title": "AgriConsult.API", "version": "1.0" }, "paths": { "/api/auth/register": { "post": { "tags": [ "AgriConsult.API" ], "operationId": "Register", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" } } } }, "/api/auth/login": { "post": { "tags": [ "AgriConsult.API" ], "operationId": "Login", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" } } } }, "/api/v1/experts": { "get": { "tags": [ "AgriConsult.API" ], "operationId": "GetExperts", "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "AgriConsult.API" ], "operationId": "CreateExpert", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Expert" } } }, "required": true }, "responses": { "200": { "description": "OK" } } } }, "/api/v1/experts/{id}": { "get": { "tags": [ "AgriConsult.API" ], "operationId": "GetExpertById", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "AgriConsult.API" ], "operationId": "DeleteExpert", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v1/consultations": { "post": { "tags": [ "AgriConsult.API" ], "operationId": "BookConsultation", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookConsultationRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" } } } }, "/api/v1/consultations/my": { "get": { "tags": [ "AgriConsult.API" ], "operationId": "GetMyConsultations", "responses": { "200": { "description": "OK" } } } }, "/api/v1/consultations/{id}/status": { "put": { "tags": [ "AgriConsult.API" ], "operationId": "UpdateConsultationStatus", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateStatusRequest" } } }, "required": true }, "responses": { "200": { "description": "OK" } } } } }, "components": { "schemas": { "BookConsultationRequest": { "type": "object", "properties": { "expertId": { "type": "integer", "format": "int32" }, "topic": { "type": "string", "nullable": true } }, "additionalProperties": false }, "Expert": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string", "nullable": true }, "specialization": { "type": "string", "nullable": true }, "fee": { "type": "number", "format": "double" }, "rating": { "type": "number", "format": "double" }, "isApproved": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "LoginRequest": { "type": "object", "properties": { "email": { "type": "string", "nullable": true }, "password": { "type": "string", "nullable": true } }, "additionalProperties": false }, "RegisterRequest": { "type": "object", "properties": { "fullName": { "type": "string", "nullable": true }, "email": { "type": "string", "nullable": true }, "password": { "type": "string", "nullable": true } }, "additionalProperties": false }, "UpdateStatusRequest": { "type": "object", "properties": { "status": { "type": "string", "nullable": true } }, "additionalProperties": false } }, "securitySchemes": { "Bearer": { "type": "http", "description": "Enter your JWT token here", "scheme": "Bearer", "bearerFormat": "JWT" } } }, "security": [ { "Bearer": [ ] } ] }