diff --git a/thoughts-backend/doc/src/api_key.rs b/thoughts-backend/doc/src/api_key.rs new file mode 100644 index 0000000..669b2f4 --- /dev/null +++ b/thoughts-backend/doc/src/api_key.rs @@ -0,0 +1,16 @@ +use api::{models::ApiErrorResponse, routers::api_key::*}; +use models::schemas::api_key::{ApiKeyListSchema, ApiKeyRequest, ApiKeyResponse, ApiKeySchema}; +use utoipa::OpenApi; + +#[derive(OpenApi)] +#[openapi( + paths(get_keys, create_key, delete_key), + components(schemas( + ApiKeySchema, + ApiKeyListSchema, + ApiKeyRequest, + ApiKeyResponse, + ApiErrorResponse, + )) +)] +pub(super) struct ApiKeyApi; diff --git a/thoughts-backend/doc/src/lib.rs b/thoughts-backend/doc/src/lib.rs index a8de08a..c0da6c3 100644 --- a/thoughts-backend/doc/src/lib.rs +++ b/thoughts-backend/doc/src/lib.rs @@ -6,9 +6,11 @@ use utoipa::{ use utoipa_scalar::{Scalar, Servable as ScalarServable}; use utoipa_swagger_ui::SwaggerUi; +mod api_key; mod auth; mod feed; mod root; +mod tag; mod thought; mod user; @@ -18,8 +20,10 @@ mod user; (path = "/", api = root::RootApi), (path = "/auth", api = auth::AuthApi), (path = "/users", api = user::UserApi), + (path = "/users/me/api-keys", api = api_key::ApiKeyApi), (path = "/thoughts", api = thought::ThoughtApi), (path = "/feed", api = feed::FeedApi), + (path = "/tags", api = tag::TagApi), ), tags( (name = "root", description = "Root API"), @@ -27,6 +31,7 @@ mod user; (name = "user", description = "User & Social API"), (name = "thought", description = "Thoughts API"), (name = "feed", description = "Feed API"), + (name = "tag", description = "Tag Discovery API"), ), modifiers(&SecurityAddon), )] diff --git a/thoughts-backend/doc/src/tag.rs b/thoughts-backend/doc/src/tag.rs new file mode 100644 index 0000000..f5316b9 --- /dev/null +++ b/thoughts-backend/doc/src/tag.rs @@ -0,0 +1,12 @@ +// in thoughts-backend/doc/src/tag.rs + +use api::{models::ApiErrorResponse, routers::tag::*}; +use models::schemas::thought::{ThoughtListSchema, ThoughtSchema}; +use utoipa::OpenApi; + +#[derive(OpenApi)] +#[openapi( + paths(get_thoughts_by_tag, get_popular_tags), + components(schemas(ThoughtSchema, ThoughtListSchema, ApiErrorResponse)) +)] +pub(super) struct TagApi; diff --git a/thoughts-backend/doc/src/user.rs b/thoughts-backend/doc/src/user.rs index 74af981..26dd7fd 100644 --- a/thoughts-backend/doc/src/user.rs +++ b/thoughts-backend/doc/src/user.rs @@ -2,7 +2,7 @@ use utoipa::OpenApi; use api::models::{ApiErrorResponse, ParamsErrorResponse}; use api::routers::user::*; -use models::params::user::CreateUserParams; +use models::params::user::{CreateUserParams, UpdateUserParams}; use models::schemas::{ thought::{ThoughtListSchema, ThoughtSchema}, user::{UserListSchema, UserSchema}, @@ -24,6 +24,7 @@ use models::schemas::{ components(schemas( CreateUserParams, UserListSchema, + UpdateUserParams, UserSchema, ThoughtSchema, ThoughtListSchema,