confluent-kafka-python
confluent-kafka-python copied to clipboard
Allow strict validation with `fastavro`, to fail when extra fields are present in the records
Description
Currently, if json data has extra fields in the record, AvroSerializer will not fail, it will silently ignore the extra fields, which can be detrimental in some applications, for example which rely on gathering data from 3rd party APIs.
Recenly, fastavro added options of strict and strict_allow_default to schemaless_writer (see source code here and here for discussion), which will make the validation fail if there are extra fields in the record.
I propose to add this feature in AvroSerializer, I guess these would be simply passthrough parameters to schemaless_writer.
sounds good. i think we should be able to review this pretty quickly, else it's on the todo list.
I'll give it a go!
thanks - noted.
When will it be merged? @mhowlett