From 6141cefa4159d73116eadb38e10f611178a58072 Mon Sep 17 00:00:00 2001 From: DSeeLP <46624152+DSeeLP@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:24:07 +0200 Subject: [PATCH] add request body schema to change password endpoint --- bank_core/src/lib.rs | 2 +- bank_core/src/util.rs | 2 ++ openapi-def.yaml | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bank_core/src/lib.rs b/bank_core/src/lib.rs index 16e84c2..9b1eea3 100644 --- a/bank_core/src/lib.rs +++ b/bank_core/src/lib.rs @@ -11,4 +11,4 @@ mod util; pub use error::*; pub use util::*; -make_schemas!((Credentials); (ApiError, TokenResponse), [account::schemas, chat::schemas, transaction::schemas, user::schemas, meta::schemas]); +make_schemas!((Credentials, ChangePassword); (ApiError, TokenResponse), [account::schemas, chat::schemas, transaction::schemas, user::schemas, meta::schemas]); diff --git a/bank_core/src/util.rs b/bank_core/src/util.rs index ed35bab..5143306 100644 --- a/bank_core/src/util.rs +++ b/bank_core/src/util.rs @@ -5,6 +5,8 @@ use regex::Regex; use serde::{Deserialize, Serialize}; use uuid::Uuid; +use crate::make_schemas; + pub static NAME_PATTERN_RE: LazyLock = LazyLock::new(|| Regex::new(NAME_PATTERN).unwrap()); pub static USER_ACCOUNT_PATTERN_RE: LazyLock = LazyLock::new(|| Regex::new(USER_ACCOUNT_PATTERN).unwrap()); diff --git a/openapi-def.yaml b/openapi-def.yaml index 7ecbfbf..4896431 100644 --- a/openapi-def.yaml +++ b/openapi-def.yaml @@ -150,6 +150,11 @@ paths: - Users security: - bearer: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangePassword' responses: 200: description: Ok