Strip Pydantic property titles before generating TypeScript
@benz16107▲ 0 net votes
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.