Refactor handlers and OpenAPI documentation for improved readability and consistency
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 6m49s
test / unit (pull_request) Successful in 16m24s
test / integration (pull_request) Failing after 17m7s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 6m49s
test / unit (pull_request) Successful in 16m24s
test / integration (pull_request) Failing after 17m7s
- Reorganized imports in health, notifications, social, thoughts, and users handlers for clarity. - Updated function signatures in handlers to improve readability by aligning parameters. - Enhanced JSON response formatting in notifications and thoughts handlers. - Improved error handling in user-related functions. - Refactored OpenAPI documentation to maintain consistent formatting and structure. - Cleaned up unnecessary code and comments across various files. - Ensured consistent use of `Arc` for shared state in AppState and WorkerHandlers.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
use api_types::{
|
||||
requests::CreateApiKeyRequest,
|
||||
responses::{ApiKeyResponse, CreatedApiKeyResponse},
|
||||
};
|
||||
use utoipa::OpenApi;
|
||||
use api_types::{requests::CreateApiKeyRequest, responses::{ApiKeyResponse, CreatedApiKeyResponse}};
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
use api_types::{
|
||||
requests::{LoginRequest, RegisterRequest},
|
||||
responses::{AuthResponse, ErrorResponse},
|
||||
};
|
||||
use utoipa::OpenApi;
|
||||
use api_types::{requests::{LoginRequest, RegisterRequest}, responses::{AuthResponse, ErrorResponse}};
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
paths(crate::handlers::auth::post_register, crate::handlers::auth::post_login),
|
||||
paths(
|
||||
crate::handlers::auth::post_register,
|
||||
crate::handlers::auth::post_login
|
||||
),
|
||||
components(schemas(RegisterRequest, LoginRequest, AuthResponse, ErrorResponse))
|
||||
)]
|
||||
pub struct AuthDoc;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use utoipa::OpenApi;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
paths(
|
||||
crate::handlers::feed::home_feed,
|
||||
crate::handlers::feed::public_feed,
|
||||
crate::handlers::feed::search_handler,
|
||||
crate::handlers::feed::user_thoughts_handler,
|
||||
crate::handlers::feed::tag_thoughts_handler,
|
||||
),
|
||||
)]
|
||||
#[openapi(paths(
|
||||
crate::handlers::feed::home_feed,
|
||||
crate::handlers::feed::public_feed,
|
||||
crate::handlers::feed::search_handler,
|
||||
crate::handlers::feed::user_thoughts_handler,
|
||||
crate::handlers::feed::tag_thoughts_handler,
|
||||
))]
|
||||
pub struct FeedDoc;
|
||||
|
||||
@@ -9,8 +9,8 @@ mod users;
|
||||
|
||||
use axum::Router;
|
||||
use utoipa::{
|
||||
Modify, OpenApi,
|
||||
openapi::security::{ApiKey, ApiKeyValue, Http, HttpAuthScheme, SecurityScheme},
|
||||
Modify, OpenApi,
|
||||
};
|
||||
use utoipa_scalar::{Scalar, Servable};
|
||||
use utoipa_swagger_ui::SwaggerUi;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utoipa::OpenApi;
|
||||
use api_types::requests::SetTopFriendsRequest;
|
||||
use utoipa::OpenApi;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
use api_types::{
|
||||
requests::{CreateThoughtRequest, EditThoughtRequest},
|
||||
responses::ErrorResponse,
|
||||
};
|
||||
use utoipa::OpenApi;
|
||||
use api_types::{requests::{CreateThoughtRequest, EditThoughtRequest}, responses::ErrorResponse};
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
use api_types::{
|
||||
requests::UpdateProfileRequest,
|
||||
responses::{ErrorResponse, UserResponse},
|
||||
};
|
||||
use utoipa::OpenApi;
|
||||
use api_types::{requests::UpdateProfileRequest, responses::{UserResponse, ErrorResponse}};
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
|
||||
Reference in New Issue
Block a user