From 8c602ac72b84ff4000474a8a24ef97bae1acade0 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 3 Dec 2024 16:01:04 +0100 Subject: [PATCH] backend/handler: return json for json internal endpoint --- nghe-proc-macro/src/backend.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nghe-proc-macro/src/backend.rs b/nghe-proc-macro/src/backend.rs index 572a58c6..732a724c 100644 --- a/nghe-proc-macro/src/backend.rs +++ b/nghe-proc-macro/src/backend.rs @@ -294,9 +294,9 @@ pub fn handler(attr: TokenStream, item: TokenStream) -> Result Result, Error> { + ) -> Result::Response>, Error> { let response = #ident(#( #pass_args ),*).await?; - Ok(bitcode::serialize(&response)?) + Ok(axum::Json(response)) } } } @@ -309,7 +309,7 @@ pub fn handler(attr: TokenStream, item: TokenStream) -> Result