Skip to content

9.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Jun 19:43

This major release includes improvements to component model and data contract attribute usage.

Breaking changes

  • When generating schemas for decimal, Chr.Avro attempts to use the [Range] attribute to infer decimal precision and scale (#216). For example, given the following class:

    public class SensorReading
    {
        [Range(typeof(decimal), "0.000", "1.000", ConvertValueInInvariantCulture = true)]
        public decimal Value { get; set; }
    }

    The schema builder would generate:

    {
        "name": "SensorReading",
        "type": "record",
        "fields": [{
            "name": "Value",
            "type": {
                "type": "bytes",
                "logicalType": "decimal"
                "precision": 4,
                "scale": 3
            }
        }]
    }

    If precision and scale cannot be inferred, Chr.Avro will fall back to the defaults (29 and 14, respectively).

  • When serializing enum types to "string" schemas, Chr.Avro uses the [EnumMember] attribute value if one is set (#217). This matches the behavior of the schema builder for enum types when behavior is set to Symbolic (the default).