Skip to content

Commit 7525ab2

Browse files
authored
Skip serializing null app_id in application password params (#1048)
WordPress 6.9-RC3 rejects `app_id: null` in the application-passwords endpoint, returning "Invalid parameter(s): app_id". This is a regression from previous versions where null was accepted. Changes: - Add `#[serde(skip_serializing_if = "Option::is_none")]` to `app_id` in `ApplicationPasswordCreateParams` and `ApplicationPasswordUpdateParams`
1 parent 8875d2f commit 7525ab2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wp_api/src/application_passwords.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub struct IpAddress {
5353
pub struct ApplicationPasswordCreateParams {
5454
/// A UUID provided by the application to uniquely identify it.
5555
/// It is recommended to use an UUID v5 with the URL or DNS namespace.
56+
#[serde(skip_serializing_if = "Option::is_none")]
5657
pub app_id: Option<String>,
5758
/// The name of the application password.
5859
pub name: String,
@@ -74,6 +75,7 @@ pub struct ApplicationPasswordDeleteAllResponse {
7475
pub struct ApplicationPasswordUpdateParams {
7576
/// A UUID provided by the application to uniquely identify it.
7677
/// It is recommended to use an UUID v5 with the URL or DNS namespace.
78+
#[serde(skip_serializing_if = "Option::is_none")]
7779
pub app_id: Option<String>,
7880
/// The name of the application password.
7981
pub name: String,

0 commit comments

Comments
 (0)