colinhacks / zod

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

feat: Adding json Schema to the package #3750

Open PandaWorker opened 1 week ago

PandaWorker commented 1 week ago

How about adding json Schema generation to the package of the new version immediately for full compatibility of the Open API 3.1.0?

See that the Json schema of the latest project (2020-12) is added from behind the crust. This helps not to use separate packages to generate jsonSchema, which can then be used to generate OpenAPI (swagger)

I just want to use zod for request/response contracts, and the framework would already use ready-made JsonSchema to generate OpenAPI schemes. I'll give you an example, Json Schema is supplied to type box immediately out of the box, As well as for python, the most popular library for validation and serialization pydantic supplies JsonSchema immediately, and OpenAPI API endpoint schemes are already being built on its basis.