colinhacks / zod

TypeScript-first schema validation with static type inference
https://zod.dev
MIT License
33.34k stars 1.15k forks source link

Add title for meta #1831

Open wenerme opened 1 year ago

wenerme commented 1 year ago

There is already describe https://github.com/colinhacks/zod/commit/e2389b0312fb1b280a90d4bd1f10d099178aec9a , please add a title for schema, want to use like json schema , but missing title makes generate form and other ui harder.

JacobWeisenburger commented 9 months ago

What would title do?

wenerme commented 9 months ago

Maybe not title, how about allow attach a meta: Record<string,any> ?

JacobWeisenburger commented 9 months ago

ok, what would meta do?

wenerme commented 9 months ago

I want to add some schema related in meta, like $id in json schema, using zod as source of truth I want to attach meta to keep info in schema. Maybe zod should not used as general schema ?