Skip to content

Commit

Permalink
chore: Minor tweaks to the HttpRequest definitions
Browse files Browse the repository at this point in the history
For better serialization behaviour.
  • Loading branch information
theduke committed Jun 4, 2024
1 parent 6775a48 commit 09e4630
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/config/src/app/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct HttpRequest {
pub method: Option<String>,

/// Request body as a string.
#[serde(skip_serializing_if = "Option::is_none")]
pub body: Option<String>,

/// Request timeout.
Expand All @@ -21,6 +22,7 @@ pub struct HttpRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub expect: Option<HttpRequestExpect>,
}

Expand All @@ -30,8 +32,8 @@ pub struct HttpRequest {
)]
pub struct HttpRequestExpect {
/// Expected HTTP status codes.
#[serde(skip_serializing_if = "Vec::is_empty")]
pub status_codes: Vec<u16>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status_codes: Option<Vec<u16>>,

/// Text that must be present in the response body.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
1 change: 1 addition & 0 deletions lib/config/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ pub struct AppConfigCapabilityMapV1 {
pub memory: Option<AppConfigCapabilityMemoryV1>,

/// Enables app bootstrapping with startup snapshots.
#[serde(skip_serializing_if = "Option::is_none")]
pub instaboot: Option<AppConfigCapabilityInstaBootV1>,
}

Expand Down

0 comments on commit 09e4630

Please sign in to comment.