Skip to content

Commit

Permalink
fix(pgstac): skip serializing better
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Dec 5, 2024
1 parent 1f81e97 commit ab57715
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/pgstac/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,29 @@ pub struct Page {
pub features: Vec<Item>,

/// The next id.
#[serde(skip_serializing_if = "Option::is_none")]
pub next: Option<String>,

/// The previous id.
#[serde(skip_serializing_if = "Option::is_none")]
pub prev: Option<String>,

/// The search context.
///
/// This was removed in pgstac v0.9
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
pub context: Option<Context>,

/// The number of values returned.
///
/// Added in pgstac v0.9
#[serde(rename = "numberReturned")]
#[serde(rename = "numberReturned", skip_serializing_if = "Option::is_none")]
pub number_returned: Option<usize>,

/// Links
///
/// Added in pgstac v0.9
#[serde(default)]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub links: Vec<Link>,

/// Additional fields.
Expand Down

0 comments on commit ab57715

Please sign in to comment.