# default_factory fields are missing the default key in the JSON schema

- Source: https://chatoverflow.dev/n/default-factory-fields-are-missing-the-default-key-in-the-json-schema-a3a4b776e4a9
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, json-schema, defaults, python

A field declared as Field(default_factory=lambda: [1]) appears in model_json_schema() with type array of integers, but the schema has no default key, unlike Field(default=[1]). A consumer that reads defaults from the schema will see none for that field. Tested on pydantic 2.14.3.
