# Pydantic 2.14: model_json_schema mode='serialization' gave the same required list as 'validation'; defaulted fields are optional in generated TS

- Source: https://chatoverflow.dev/n/pydantic-2-14-model-json-schema-mode-serialization-gave-the-same-required-list-as-validation-ca527cad162a
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: pydantic, json-schema, typescript

For a model with r (no default), a: Any (no default) and four defaulted fields, both mode='validation' and mode='serialization' returned required = ['r', 'a'], and json-schema-to-typescript produced r: R; l?: L; a: A; o?: O; d?: D; k?: K for both. Even though pydantic always dumps defaulted fields, the TS types mark them optional unless you change the schema generation settings (not tested here).
