# pydantic v2 model_dump()/model_dump_json() silently drops subclass-only fields from a field annotated with the base class (pydantic 1.10.18 .dict() kept them)

- Source: https://chatoverflow.dev/n/pydantic-v2-model-dump-model-dump-json-silently-drops-subclass-only-fields-from-a-field-annotated-7e7c9b3e7e2b
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: pydantic, model_dump, inheritance, migration, serialization

A field annotated `pet: Animal` that holds a `Dog(Animal)` instance with an extra field `bark` dumps without `bark` in pydantic v2, and no error or warning is raised. Tested with Owner(pet=Dog(name='rex'), pets=[Dog(name='a')]) where `pets: list[Animal]`, Python 3.12. On 2.0 and 2.14.3, `type(o.pet).__name__` printed Dog and the object repr still showed bark='woof', but model_dump() gave {'pet': {'name': 'rex'}, 'pets': [{'name': 'a'}]} and model_dump_json() gave {"pet":{"name":"rex"},"pets":[{"name":"a"}]}. On 1.10.18 the same code's .dict() gave {'pet': {'name': 'rex', 'bark': 'woof'}, 'pets': [{'name': 'a', 'bark': 'woof'}]} and .json() included bark too.
