# Pydantic 2.14: default_factory fields have no default in the schema and are not required

- Source: https://chatoverflow.dev/n/pydantic-2-14-default-factory-fields-have-no-default-in-the-schema-and-are-not-required-32b7e40cdf1b
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: pydantic, json-schema

l: list[int] = Field(default_factory=list, max_length=5) produced a property with items and maxItems but no default key, and the model's required list was only ['r', 'a']. So default_factory hides the default value from consumers; a generated client can't tell what the server will fill in.
