{"_id":"@anstatsig/zod-openapi","_rev":"9-088b90b10e8284a2b3838cb072126389","name":"@anstatsig/zod-openapi","dist-tags":{"latest":"2.3.5"},"versions":{"2.2.6":{"name":"@anstatsig/zod-openapi","version":"2.2.6","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.2.6","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anatine/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anatine/zod-plugins/issues"},"dist":{"shasum":"a615258d8f1d70f60715373aa39c1b0c777fcadf","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.2.6.tgz","fileCount":13,"integrity":"sha512-nyMKcyp+sCTiCmf+z6uoKOJCnPSEoNgYc2B2D+9g88c3nzvYllDNxBfw6nS66vozR/HV0+vFUsxTobmhkg29aA==","signatures":[{"sig":"MEUCIQCD25OjM3uQcVouwJtqJ8Qe/2FPCIWA3+Flm+Rz3aVbLAIgVaS/VBf/CJGUH53LtxpocZD5IKD1LSOsylaWsixs8v4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47916},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anatine/zod-plugins.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.2.6_1723598165368_0.0709646480187689","host":"s3://npm-registry-packages"}},"2.2.7":{"name":"@anstatsig/zod-openapi","version":"2.2.7","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.2.7","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-plugins/issues"},"dist":{"shasum":"2314528d9d29c1a5c29769735adec71614736deb","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.2.7.tgz","fileCount":13,"integrity":"sha512-LwKRZK1lcp7dimImVAJRQReYfT+V9grs4nfk+2X9l2sNXsGsccF0IgmqAIFyhPepONce/YBHFvLGwPdb9f90tw==","signatures":[{"sig":"MEUCICPIvL1xvUTkQE9kYqk2l68CZe586oD+sACZgPbAvQblAiEA6jJuIUdjORN3ydc0ULB4fZDXnr7d0+B8f/cNaNLXv+8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47920},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-plugins.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.2.7_1723598286561_0.32311731316026227","host":"s3://npm-registry-packages"}},"2.2.8":{"name":"@anstatsig/zod-openapi","version":"2.2.8","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.2.8","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-plugins/issues"},"dist":{"shasum":"856c94e014261abae504f64c3190f015aef140d8","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.2.8.tgz","fileCount":13,"integrity":"sha512-55P73opMCxb8E9uz4w6QHM2OjZpWk55CDON1w0pyvNr16KZD/+VsMgTmSL9u54EOnavrgslr5iRVHkOe1N+25g==","signatures":[{"sig":"MEUCIQDuy5Z5+AWUpwR+b0osSPd2PZVO5su5VZ6Oo0Wa/Uep8QIgNPZ6libpkG7cCITbwGdvIwfw8Yh/TMhKZtZ5fCgDJUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47921},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-plugins.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.2.8_1723605885978_0.8552900459747295","host":"s3://npm-registry-packages"}},"2.2.9":{"name":"@anstatsig/zod-openapi","version":"2.2.9","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.2.9","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-plugins/issues"},"dist":{"shasum":"320b4cb3a89eca81649d16471d6e3c9b3d47610c","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.2.9.tgz","fileCount":13,"integrity":"sha512-lpOFdn2q/rWsPip/dx59Cv9nOIzTcK2rRODDGWmB0sGCSedjsAEbtvKStYEX0ueQO5MnmPhGcmoKpQKHQ2ienA==","signatures":[{"sig":"MEUCIQD96YCCEig4B898S/XTrKA3KSOGotObqY+M79qQfdhOUQIgRSkJG89Pj6or9F5t7bRR9542YvsX+FxxcfIWqYS4gkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48020},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-plugins.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.2.9_1723687923862_0.3279521000612309","host":"s3://npm-registry-packages"}},"2.3.0":{"name":"@anstatsig/zod-openapi","version":"2.3.0","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.3.0","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"dist":{"shasum":"860ca0c10ae8ac484082bb5c899fab72bfa4ce42","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.0.tgz","fileCount":13,"integrity":"sha512-1dbCRBWfzjZmU55QxljFCW86zMlFKHkTtf0gZ4EHDuT+8OQlXFGAUKQotMuMPdlK03M2fuW9EPPtDgoxgizGyg==","signatures":[{"sig":"MEQCICKgkYkunB05MaeTooOugj4xfpTcbHHtZJ1wGrJuGARmAiBu7BkjyDw8aCyEZRZuHmJC4XxnkSZnWA23OErmXlTBkw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48138},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.3.0_1724195292528_0.2194097159367483","host":"s3://npm-registry-packages"}},"2.3.1":{"name":"@anstatsig/zod-openapi","version":"2.3.1","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.3.1","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"dist":{"shasum":"02342ebb0ec12fa1cfab4800b957a8ce1db625e1","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.1.tgz","fileCount":13,"integrity":"sha512-chPw+Baof8m6868g63tze8+HfsTV+YftC+KUMSkLdHgFIvwIU2ufE44+qGy5VSljBh8DPgYbTYhFjWV/i8hs8Q==","signatures":[{"sig":"MEUCIQCMCdYuNvl5qR3tyuykFohN6Zh+RMpyAGXjfHT0IaiRXgIgEQDpObOyhkye1lbscBBZJMQpcAc1LEuH8X2zxWrGch0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48138},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.3.1_1724195497451_0.8491667104517944","host":"s3://npm-registry-packages"}},"2.3.2":{"name":"@anstatsig/zod-openapi","version":"2.3.2","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.3.2","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"dist":{"shasum":"d76feb154a90bef0a8daf85150598209aa27f41b","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.2.tgz","fileCount":13,"integrity":"sha512-eS9Ubl1v04MqXClYBUd3vZjrescFnktE50O7q/wj5RdAjC9wuPVkmIFnPs9L7U8Z2/00KzYzVww2/EY3M6a5aA==","signatures":[{"sig":"MEUCIApgT0r3YoUdIg38K03hK50aRWODuiOVVGzTSMHocqz1AiEAkmPzM6Nxn39PADHf9Bqifl9NelyyyZulw9b8KBoqWOQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48020},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.3.2_1724196179798_0.0818100431604516","host":"s3://npm-registry-packages"}},"2.3.3":{"name":"@anstatsig/zod-openapi","version":"2.3.3","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.3.3","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"dist":{"shasum":"6abfe38f14e2461b07384afce4b9a61823d81fb2","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.3.tgz","fileCount":13,"integrity":"sha512-708sgoHS3wzKtsKWvzTgSHx54to1yrzpa+1AR4kPs94irQCtGGtluSi2fJquJQJcXVk+M7+bFl7UCs50uhBHRw==","signatures":[{"sig":"MEUCIBu5X4Xh0IG2uywEAkVXk/4k+fOKU/nD9OUSrP2YAwoxAiEAqtakr3w/wTFhhqmYJFpLhwmT/edsOjpVrZN0N6q41IM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48138},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"9d03494546f5d3ca7b1c0426cb99c17f75eeadcc","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.3.3_1724196730372_0.3874139293505807","host":"s3://npm-registry-packages"}},"2.3.4":{"name":"@anstatsig/zod-openapi","version":"2.3.4","keywords":["zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/brianmcbride","name":"Brian McBride"},"license":"MIT","_id":"@anstatsig/zod-openapi@2.3.4","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"dist":{"shasum":"99cf0ba89b992cfe205abc007ca2ead113f6af38","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.4.tgz","fileCount":13,"integrity":"sha512-jCUoA0m8GTq1ieAidwYwjGlY3tLywNx4JoJHZAObbxgWTLbmJ53hImt1s7ZkWROtAUHDnr36HB/pLafp2X+fCw==","signatures":[{"sig":"MEQCIB/Rn/I9fjjuyEFXdbMbBvF0GGIZDQQ6PRuyLLZxQK5RAiB5u1Qi52imQvCl5r8rReHp/RKTxSQQATtXwrif27k8/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49477},"main":"src/index.js","types":"src/index.d.ts","public":true,"gitHead":"849ccba5602d3194be88c6000b2861bf4dc4abe0","_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"Zod to OpenAPI converter","directories":{},"_nodeVersion":"20.13.1","dependencies":{"ts-deepmerge":"^6.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"zod":"^3.20.0","openapi3-ts":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/zod-openapi_2.3.4_1724198739399_0.4651879693801788","host":"s3://npm-registry-packages"}},"2.3.5":{"name":"@anstatsig/zod-openapi","version":"2.3.5","description":"Zod to OpenAPI converter","main":"src/index.js","types":"src/index.d.ts","license":"MIT","public":true,"repository":{"type":"git","url":"git+https://github.com/anstatsig/zod-openapi.git"},"homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","author":{"name":"Brian McBride","url":"https://www.linkedin.com/in/brianmcbride"},"keywords":["zod","openapi","swagger"],"dependencies":{"ts-deepmerge":"^6.0.3"},"peerDependencies":{"openapi3-ts":"^4.1.2","zod":"^3.20.0"},"_id":"@anstatsig/zod-openapi@2.3.5","gitHead":"849ccba5602d3194be88c6000b2861bf4dc4abe0","bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-ATuRcxaNQL4kInJQKTl3arp7ewIbDZQshdli70PVu7uUNq49IMusXH9NJltv8Kvh4gFZGwSs2S7KdDZnlmh71g==","shasum":"359ee1d2d63c3078e6c3f17be77c73dc49d804ad","tarball":"https://registry.npmjs.org/@anstatsig/zod-openapi/-/zod-openapi-2.3.5.tgz","fileCount":13,"unpackedSize":48138,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8Tvn8M5Ik+sicEm723kJyVGbxaRBhChSljMG+oDkJvQIhAONTvCXeWrYE3BfBXfFlqNJHyQk9L6rlhxWcg1+LBjPR"}]},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"directories":{},"maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zod-openapi_2.3.5_1724200726912_0.5154118052895653"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-14T01:16:05.224Z","modified":"2024-08-21T00:38:47.325Z","2.2.6":"2024-08-14T01:16:05.591Z","2.2.7":"2024-08-14T01:18:06.859Z","2.2.8":"2024-08-14T03:24:46.175Z","2.2.9":"2024-08-15T02:12:04.075Z","2.3.0":"2024-08-20T23:08:12.764Z","2.3.1":"2024-08-20T23:11:37.599Z","2.3.2":"2024-08-20T23:22:59.937Z","2.3.3":"2024-08-20T23:32:10.663Z","2.3.4":"2024-08-21T00:05:39.588Z","2.3.5":"2024-08-21T00:38:47.138Z"},"bugs":{"url":"https://github.com/anstatsig/zod-openapi/issues"},"author":{"name":"Brian McBride","url":"https://www.linkedin.com/in/brianmcbride"},"license":"MIT","homepage":"https://github.com/anstatsig/zod-plugins/tree/main/packages/zod-openapi","keywords":["zod","openapi","swagger"],"repository":{"type":"git","url":"git+https://github.com/anstatsig/zod-openapi.git"},"description":"Zod to OpenAPI converter","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"readme":"# @anatine/zod-openapi\n\nConverts a [Zod](https://github.com/colinhacks/zod) schema to an OpenAPI `SchemaObject` as defined by [openapi3-ts](https://www.npmjs.com/package/openapi3-ts)\n\n----\n\n## Installation\n\nBoth openapi3-ts and zod are peer dependencies instead of dependant packages.\nWhile `zod` is necessary for operation, `openapi3-ts` is for type-casting.\n\n```shell\nnpm install openapi3-ts zod @anatine/zod-openapi\n```\n\n----\n\n## Usage\n\n### Take any Zod schema and convert it to an OpenAPI JSON object\n\n```typescript\nimport { generateSchema } from '@anatine/zod-openapi';\nconst aZodSchema = z.object({\n  uid: z.string().nonempty(),\n  firstName: z.string().min(2),\n  lastName: z.string().optional(),\n  email: z.string().email(),\n  phoneNumber: z.string().min(10).optional(),\n})\nconst myOpenApiSchema = generateSchema(aZodSchema);\n// ...\n```\n\nThis will generate an OpenAPI schema for `myOpenApiSchema`\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"uid\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"firstName\": {\n      \"type\": \"string\",\n      \"minLength\": 2\n    },\n    \"lastName\": {\n      \"type\": \"string\"\n    },\n    \"email\": {\n      \"type\": \"string\",\n      \"format\": \"email\"\n    },\n    \"phoneNumber\": {\n      \"type\": \"string\",\n      \"minLength\": 10\n    }\n  },\n  \"required\": [\n    \"uid\",\n    \"firstName\",\n    \"email\"\n  ]\n}\n```\n\n### Extend a Zod schema with additional OpenAPI schema via a function wrapper\n\n```typescript\nimport { extendApi, generateSchema } from '@anatine/zod-openapi';\nconst aZodExtendedSchema = extendApi(\n      z.object({\n        uid: extendApi(z.string().nonempty(), {\n          title: 'Unique ID',\n          description: 'A UUID generated by the server',\n        }),\n        firstName: z.string().min(2),\n        lastName: z.string().optional(),\n        email: z.string().email(),\n        phoneNumber: extendApi(z.string().min(10), {\n          description: 'US Phone numbers only',\n          example: '555-555-5555',\n        }),\n      }),\n      {\n        title: 'User',\n        description: 'A user schema',\n      }\n    );\nconst myOpenApiSchema = generateSchema(aZodExtendedSchema);\n// ...\n```\n\n... or via extension of the Zod schema:\n\n```typescript\nimport { extendApi, generateSchema, extendZodWithOpenApi } from '@anatine/zod-openapi';\nimport {z} from 'zod';\n\nextendZodWithOpenApi(z);\n\nconst aZodExtendedSchema = \n      z.object({\n        uid: z.string().nonempty().openapi({\n          title: 'Unique ID',\n          description: 'A UUID generated by the server',\n        }),\n        firstName: z.string().min(2),\n        lastName: z.string().optional(),\n        email: z.string().email(),\n        phoneNumber: z.string().min(10).openapi({\n          description: 'US Phone numbers only',\n          example: '555-555-5555',\n        }),\n      }).openapi(\n      {\n        title: 'User',\n        description: 'A user schema',\n      }\n    );\nconst myOpenApiSchema = generateSchema(aZodExtendedSchema);\n// ...\n```\n\nThis will generate an extended schema:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"uid\": {\n      \"type\": \"string\",\n      \"minLength\": 1,\n      \"title\": \"Unique ID\",\n      \"description\": \"A UUID generated by the server\"\n    },\n    \"firstName\": {\n      \"type\": \"string\",\n      \"minLength\": 2\n    },\n    \"lastName\": {\n      \"type\": \"string\"\n    },\n    \"email\": {\n      \"type\": \"string\",\n      \"format\": \"email\"\n    },\n    \"phoneNumber\": {\n      \"type\": \"string\",\n      \"minLength\": 10,\n      \"description\": \"US Phone numbers only\",\n      \"example\": \"555-555-5555\"\n    }\n  },\n  \"required\": [\n    \"uid\",\n    \"firstName\",\n    \"email\",\n    \"phoneNumber\"\n  ],\n  \"title\": \"User\",\n  \"description\": \"A user schema\"\n}\n```\n\n----\n\n## Credits\n\n- ### [express-zod-api](https://github.com/RobinTail/express-zod-api)\n\n  A great lib that provided some insights on dealing with various zod types.\n\n- ### [zod-dto](https://github.com/kbkk/abitia/tree/master/packages/zod-dto)\n\n  Lib providing insights into using Zod with NestJS\n\n----\n\nThis library is part of a nx monorepo [@anatine/zod-plugins](https://github.com/anatine/zod-plugins).\n","readmeFilename":"README.md"}