marcosschroh / dataclasses-avroschema

Generate avro schemas from python dataclasses, Pydantic models and Faust Records. Code generation from avro schemas. Serialize/Deserialize python instances with avro schemas.
https://marcosschroh.github.io/dataclasses-avroschema/
MIT License
219 stars 67 forks source link

Potential solution to #749 #752

Closed drawnwren closed 1 month ago

drawnwren commented 2 months ago

This adds a flag that changes model_dump to recursively add a "-name" field when the dataclasses_avroschema_include_type field is set to True. This way, recursive pydantic types should have "-name" properly set so that fastavro can properly differentiate between types with the same fields.

marcosschroh commented 1 month ago

This is the proper fix https://github.com/marcosschroh/dataclasses-avroschema/pull/751