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/get/unit.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/rocie-server/src/api/get/unit.rs') diff --git a/crates/rocie-server/src/api/get/unit.rs b/crates/rocie-server/src/api/get/unit.rs index d006818..4854ea3 100644 --- a/crates/rocie-server/src/api/get/unit.rs +++ b/crates/rocie-server/src/api/get/unit.rs @@ -1,6 +1,6 @@ use actix_web::{get, web, HttpResponse, Responder, Result}; -use crate::{app::App, storage::sql::unit::{Unit, UnitId}}; +use crate::{app::App, storage::sql::unit::{Unit, UnitId, UnitIdStub}}; /// Return all registered units #[utoipa::path( @@ -30,11 +30,11 @@ pub(crate) async fn units(app: web::Data) -> Result { #[get("/unit/{id}")] pub(crate) async fn unit_by_id( app: web::Data, - id: web::Path, + id: web::Path, ) -> Result { let id = id.into_inner(); - match Unit::from_id(&app, id).await? { + match Unit::from_id(&app, id.into()).await? { Some(product) => Ok(HttpResponse::Ok().json(product)), None => Ok(HttpResponse::NotFound().finish()), } -- cgit 1.4.1