Closed bartkl closed 2 years ago
It's debatable whether this is actually a bug, but since it is a current feature that doesn't work as desired, I think "bug" serves as a decent description.
By the way, note this in the Avro spec:
default
: A default value for this field, only used when reading instances that lack the field for schema evolution purposes. The presence of a default value does not make the field optional at encoding time.
Lancaster generates default values for required record fields. I believe this to be undesired behavior, and have submitted an issue here: https://github.com/deercreeklabs/lancaster/issues/20
Chad brings up an interesting discussion there, which I intend to have here.
This issue, however, is simply about short-term remedy of the problem that validation is made impossible by the generation of a default value.
So: change the code such that required fields will have no default values, allowing for validation by end users.