From e8b0bd2b1a8668aa2baaec4fa13c35c71d54eb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C5=A0ernek?= Date: Tue, 23 May 2023 08:32:59 +0000 Subject: [PATCH] fix referencing google.protobuf messages --- axum-connect-build/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/axum-connect-build/src/lib.rs b/axum-connect-build/src/lib.rs index cf84b5f..cf76933 100644 --- a/axum-connect-build/src/lib.rs +++ b/axum-connect-build/src/lib.rs @@ -100,11 +100,12 @@ pub fn axum_connect_codegen(settings: AxumConnectGenSettings) -> anyhow::Result< let files_c = files.clone(); let writers = pbjson_build::Builder::new() .register_descriptors(&descriptor_set)? + .extern_path(".google.protobuf", "::axum_connect::pbjson_types") .generate(&["."], move |package| { output.set_file_name(format!("{}.rs", package)); files_c.deref().borrow_mut().push(output.clone()); - let file = std::fs::OpenOptions::new().append(true).open(&output)?; + let file = std::fs::OpenOptions::new().append(true).create(true).open(&output)?; Ok(BufWriter::new(file)) })?;