fix referencing google.protobuf messages

This commit is contained in:
Bojan Šernek 2023-05-23 08:32:59 +00:00 committed by Alec Thilenius
parent 7ee14669e9
commit e8b0bd2b1a

View file

@ -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))
})?;