README.md in avro-builder-0.3.0 vs README.md in avro-builder-0.3.1
- old
+ new
@@ -106,20 +106,22 @@
{
"name": "full_name",
"type": [
"null",
"string"
- ]
+ ],
+ "default": null
}
]
}
```
### Required and Optional
Fields for a record are specified as `required` or `optional`. Optional fields are
-implemented as a union in Avro, where `null` is the first type in the union.
+implemented as a union in Avro, where `null` is the first type in the union and
+the field has a default value of `null`.
### Named Types
`fixed` and `enum` fields may be specified inline as part of a record
or as standalone named types.
@@ -204,10 +206,10 @@
optional :opt_union, :union, types: [:float, :long]
end
```
For an optional union, `null` is automatically added as the first type for
-the union.
+the union and the field defaults to `null`.
### Auto-loading and Imports
Specify paths to search for definitions: