diff --git a/endpoint/src/datamodel.rs b/endpoint/src/datamodel.rs index 9f6b353..f33e4be 100644 --- a/endpoint/src/datamodel.rs +++ b/endpoint/src/datamodel.rs @@ -52,7 +52,8 @@ pub struct CarbonFootprint { pub declared_unit: DeclaredUnit, pub unitary_product_amount: StrictlyPositiveDecimal, pub p_cf_excluding_biogenic: PositiveDecimal, - pub p_cf_including_biogenic: WrappedDecimal, + #[serde(skip_serializing_if = "Option::is_none")] + pub p_cf_including_biogenic: Option, pub fossil_ghg_emissions: PositiveDecimal, pub fossil_carbon_content: PositiveDecimal, pub biogenic_carbon_content: PositiveDecimal, @@ -86,7 +87,6 @@ pub struct CarbonFootprint { pub reference_period_start: DateTime, pub reference_period_end: DateTime, - #[serde(flatten)] #[serde(skip_serializing_if = "Option::is_none")] pub geographic_scope: Option, diff --git a/endpoint/src/sample_data.rs b/endpoint/src/sample_data.rs index bbff189..1ebf5eb 100644 --- a/endpoint/src/sample_data.rs +++ b/endpoint/src/sample_data.rs @@ -56,7 +56,7 @@ lazy_static! { packaging_emissions_included: false, packaging_ghg_emissions: None, p_cf_excluding_biogenic: dec!(0.0).into(), - p_cf_including_biogenic: dec!(0.0).into(), + p_cf_including_biogenic: Some(dec!(0.0).into()), uncertainty_assessment_description: None, }; }