Skip to content

Commit

Permalink
No #[skip_serializing_none]
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Jan 29, 2025
1 parent 92cf7cd commit b598cb6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
1 change: 0 additions & 1 deletion ndc-models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ pub enum AggregateFunctionDefinition {

// ANCHOR: ExtractionFunctionDefinition
/// The definition of an aggregation function on a scalar type
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[schemars(title = "Extraction Function Definition")]
pub struct ExtractionFunctionDefinition {
Expand Down
37 changes: 19 additions & 18 deletions ndc-reference/bin/reference/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,24 +1615,25 @@ fn eval_extraction(
match extraction {
None => Ok(value),
Some(extraction) => {
let iso8601::Date::YMD { year, month, day } = iso8601::date(value.as_str().ok_or_else(|| {
(
StatusCode::INTERNAL_SERVER_ERROR,
Json(ndc_models::ErrorResponse {
details: serde_json::Value::Null,
message: "Expected date".into(),
}),
)
})?)
.map_err(|_| {
(
StatusCode::INTERNAL_SERVER_ERROR,
Json(ndc_models::ErrorResponse {
details: serde_json::Value::Null,
message: "Unable to parse date".into(),
}),
)
})?
let iso8601::Date::YMD { year, month, day } =
iso8601::date(value.as_str().ok_or_else(|| {
(
StatusCode::INTERNAL_SERVER_ERROR,
Json(ndc_models::ErrorResponse {
details: serde_json::Value::Null,
message: "Expected date".into(),
}),
)
})?)
.map_err(|_| {
(
StatusCode::INTERNAL_SERVER_ERROR,
Json(ndc_models::ErrorResponse {
details: serde_json::Value::Null,
message: "Unable to parse date".into(),
}),
)
})?
else {
return Err((
StatusCode::INTERNAL_SERVER_ERROR,
Expand Down

0 comments on commit b598cb6

Please sign in to comment.