From e536cb326a67fffd511ead4a87655ca5ef98bf29 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 23 Sep 2025 17:16:23 +0200 Subject: feat(crates/rocies-server): Don't make the newtype wrappers transparent in the openapi spec This makes using the generated code significantly easier and type safer. --- crates/rocie-server/src/api/set/product.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/rocie-server/src/api/set/product.rs') diff --git a/crates/rocie-server/src/api/set/product.rs b/crates/rocie-server/src/api/set/product.rs index 19024c7..d347ee7 100644 --- a/crates/rocie-server/src/api/set/product.rs +++ b/crates/rocie-server/src/api/set/product.rs @@ -7,7 +7,7 @@ use crate::{ storage::sql::{ barcode::Barcode, insert::Operations, - product::{Product, ProductId}, + product::{Product, ProductId, ProductIdStub}, unit::Unit, }, }; @@ -84,7 +84,7 @@ pub(crate) async fn register_product( #[post("/product/{id}/associate")] pub(crate) async fn associate_barcode( app: web::Data, - id: web::Path, + id: web::Path, barcode: web::Json, ) -> Result { let mut ops = Operations::new("associated barcode with product"); @@ -97,7 +97,7 @@ pub(crate) async fn associate_barcode( } } - match Product::from_id(&app, id.into_inner()).await? { + match Product::from_id(&app, id.into_inner().into()).await? { Some(product) => { product.associate_barcode(barcode.into_inner(), &mut ops); -- cgit 1.4.1