Skip to content

Commit

Permalink
feat: use better default for openapi/rust client (#958)
Browse files Browse the repository at this point in the history
The OpenAPI-generated Rust client by default wraps types in `Box<T>`,
which can get annoying pretty fast, in everything from `.into()` or
`Box::new` on object construction to having to do `.as_ref()` on every
`match` construct.

Setting `avoidBoxedModels=true` makes this behavior much more sane.
  • Loading branch information
sxlijin committed Sep 13, 2024
1 parent 1e911e7 commit b74ef15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/baml-runtime/src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn generate_main_baml_content(
"{cmd} --additional-properties gemName=baml_client",
),
Some("rust") => format!(
"{cmd} --additional-properties packageName=baml-client",
"{cmd} --additional-properties packageName=baml-client,avoidBoxedModels=true",
),
_ => cmd,
};
Expand Down

0 comments on commit b74ef15

Please sign in to comment.