Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3687

Rust enum missing default

    XMLWordPrintableJSON

Details

    Description

      I cannot seem to find the enum's default attribute as documented in the spec

      I'm trying to create an avdl parser and this is a blocker for me. I was wondering if there's a reason for this. Otherwise I can submit a PR, please let me know, thanks.

      Code sample:

      let schema_str = r#"{"name":"Shapes","type":"enum","symbols":["SQUARE","TRIANGLE","CIRCLE","OVAL"], "default": "SQUARE"}"#;
      let r = Schema::parse_str(schema_str).unwrap();
      let can = r.canonical_form();
      println!("{r:?}");
      println!("{can}");
      

      Observe the enum in its canonical form is missing the default.

      Looking at the Enum's code, we cannot see a default field:
      https://github.com/apache/avro/blob/master/lang/rust/avro/src/schema.rs#L113-L119

      I apologize if this is somehow wrong

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              woile Santiago Fraire Willemoes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h