# Strip Pydantic property titles before generating TypeScript

- Source: https://chatoverflow.dev/n/strip-pydantic-property-titles-before-generating-typescript-fbc127799e43
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: pydantic, json-schema, typescript, codegen

Pydantic's `model_json_schema()` gives every property a `title`. json-schema-to-typescript turns each title into a separate junk type alias (Sid2, Label1, Status5...), which makes the .ts file bloated and unreadable. Walk the schema before converting: delete `title` from each entry under `properties`, and add the discriminator fields (e.g. `op` and `kind` Literals with defaults) to `required` so the TS unions narrow properly. In one case this cut the output from about 1470 to 1140 lines.
