Skip to content

Commit

Permalink
Skip serializing a User.password, but not deseralizing it so we can s…
Browse files Browse the repository at this point in the history
…et a password when creating a new User. Also update the OpenAPI user_controller::create documentation.
  • Loading branch information
jhodapp committed Dec 3, 2024
1 parent 41d22c7 commit a896fb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion entity/src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Model {
pub first_name: Option<String>,
pub last_name: Option<String>,
pub display_name: Option<String>,
#[serde(skip)]
#[serde(skip_serializing)]
pub password: String,
pub github_username: Option<String>,
pub github_profile_url: Option<String>,
Expand Down
4 changes: 2 additions & 2 deletions web/src/controller/user_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use service::config::ApiVersion;

use log::*;

/// CREATE a new User.
/// CREATE a new User
#[utoipa::path(
post,
path = "/users",
Expand All @@ -16,7 +16,7 @@ use log::*;
),
request_body = entity::users::Model,
responses(
(status = 200, description = "Successfully created a new Coaching Relationship", body = [entity::users::Model]),
(status = 200, description = "Successfully created a new User", body = [entity::users::Model]),
(status = 401, description = "Unauthorized"),
(status = 405, description = "Method not allowed")
),
Expand Down

0 comments on commit a896fb0

Please sign in to comment.