blog api 0.2.0 version
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-11-12 05:39:37 +05:30
parent df28bb5dc6
commit 1de9490540
4 changed files with 1702 additions and 620 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@
"name": "MIT License",
"url": "https://opensource.org/licenses/MIT"
},
"version": "0.1.2"
"version": "0.2.0"
},
"servers": [
{
@@ -186,17 +186,18 @@
"type": "string",
"title": "Author Id"
}
},
{
"name": "email",
"in": "query",
"required": true,
"schema": {
"type": "string",
"title": "Email"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Author"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
@@ -491,6 +492,131 @@
}
}
},
"/auth/register": {
"post": {
"tags": [
"auth"
],
"summary": "Create User",
"operationId": "create_user_auth_register_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicUser"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/auth/login": {
"post": {
"tags": [
"auth"
],
"summary": "Login",
"operationId": "login_auth_login_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/auth/me": {
"get": {
"tags": [
"auth"
],
"summary": "Read Users Me",
"operationId": "read_users_me_auth_me_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicUser"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": []
}
]
}
},
"/auth/logout": {
"post": {
"tags": [
"auth"
],
"summary": "Logout",
"operationId": "logout_auth_logout_post",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Health Check",
@@ -573,7 +699,8 @@
"tag",
"title",
"description",
"content"
"content",
"authors"
],
"title": "Article",
"example": {
@@ -683,7 +810,15 @@
"title": "Username"
},
"email": {
"type": "string",
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
@@ -692,20 +827,31 @@
"default": true
},
"name": {
"type": "string",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"type": "string",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username",
"email",
"name",
"avatar"
"username"
],
"title": "Author",
"example": {
@@ -726,6 +872,132 @@
"type": "object",
"title": "HTTPValidationError"
},
"PublicUser": {
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
}
},
"type": "object",
"required": [
"username"
],
"title": "PublicUser",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
},
"UserAuth": {
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"password": {
"type": "string",
"minLength": 6,
"title": "Password"
}
},
"type": "object",
"required": [
"username",
"password"
],
"title": "UserAuth",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
},
"ValidationError": {
"properties": {
"loc": {
@@ -759,6 +1031,17 @@
],
"title": "ValidationError"
}
},
"securitySchemes": {
"OAuth2PasswordBearer": {
"type": "oauth2",
"flows": {
"password": {
"scopes": {},
"tokenUrl": "/auth/login"
}
}
}
}
},
"tags": [

File diff suppressed because one or more lines are too long

Binary file not shown.