Kriskras99 commented on code in PR #397:
URL: https://github.com/apache/avro-rs/pull/397#discussion_r2698901991
##########
avro_derive/src/lib.rs:
##########
@@ -166,7 +170,13 @@ fn get_data_struct_schema_def(
None => quote! { None },
};
let aliases = preserve_vec(field_attrs.alias);
- let schema_expr = type_to_schema_expr(&field.ty)?;
+ let schema_expr = match field_attrs.with {
+ With::Trait => type_to_schema_expr(&field.ty)?,
+ With::Serde(path) => {
+ quote! {#path::get_schema_in_ctxt(named_schemas,
enclosing_namespace)}
+ }
+ With::Expr(expr) => quote! {#expr(named_schemas,
enclosing_namespace)},
Review Comment:
I don't think it's possible to distinguish between a function path
`path::to::function` and a constructor `Schema::Bytes`.
Nice work adding the lambda!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]