pydantic-avro
pydantic-avro copied to clipboard
Add basic record doc support
This allows two different scenarios to work:
- Pydantic Models with docstrings have their docstring converted to an Avro record
doc
. - Avro records with
doc
get added as Pydantic Models' docstring.
Aka:
class Test(AvroBase):
"""docstring"""
c1: int
Becomes
{
"type": "record",
"namespace": "Test"
"name": "Test",
"doc": "docstring",
"fields": [{"type": "int", "name": "c1"}]
}
And visa-versa.