[ 
https://issues.apache.org/jira/browse/AVRO-3484?focusedWorklogId=761327&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761327
 ]

ASF GitHub Bot logged work on AVRO-3484:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Apr/22 19:03
            Start Date: 23/Apr/22 19:03
    Worklog Time Spent: 10m 
      Work Description: jklamer commented on code in PR #1651:
URL: https://github.com/apache/avro/pull/1651#discussion_r857013392


##########
lang/rust/avro_derive/src/lib.rs:
##########
@@ -117,16 +119,24 @@ fn get_data_struct_schema_def(
         syn::Fields::Named(ref a) => {
             for (position, field) in a.named.iter().enumerate() {
                 let name = field.ident.as_ref().unwrap().to_string(); // we 
know everything has a name
-                let field_documented =
+                let field_attrs =
                     
FieldOptions::from_attributes(&field.attrs[..]).map_err(darling_to_syn)?;
-                let doc = preserve_optional(field_documented.doc);
+                let doc = preserve_optional(field_attrs.doc);
+                let default_value = match field_attrs.default {
+                    Some(default_value) => {
+                        quote! {

Review Comment:
   oooo yeah I wasn't thinking anything so sophisticated as using the 
json::value in the quotes. Just using a dummy command and translating the 
error: https://github.com/apache/avro/pull/1668





Issue Time Tracking
-------------------

    Worklog Id:     (was: 761327)
    Time Spent: 1h 10m  (was: 1h)

> Rust: Implement derive default via annotation
> ---------------------------------------------
>
>                 Key: AVRO-3484
>                 URL: https://issues.apache.org/jira/browse/AVRO-3484
>             Project: Apache Avro
>          Issue Type: Improvement
>            Reporter: Jack Klamer
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.1, 1.12.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Origin Comment: https://github.com/apache/avro/pull/1631#discussion_r845826110
> Follow up on the avro derive work. Will want to be able to set the default 
> for a field inside a struct using annotations



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to