{"_id":"@anstatsig/nestjs-zod-openapi","_rev":"6-7651b771515ffb44e163fe8b9446aa11","name":"@anstatsig/nestjs-zod-openapi","dist-tags":{"latest":"0.1.9"},"versions":{"0.1.3":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.3","keywords":["nestjs","zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/wahyubucil","name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.3","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/wahyubucil/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/wahyubucil/nestjs-zod-openapi/issues"},"dist":{"shasum":"5af7a2a169d867e17f14276012c7000eb352e667","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.3.tgz","fileCount":12,"integrity":"sha512-5b4UjpAE7GzPxYP4/tX7In8u3bZBFG5WLljf+3JwrExpnUfQvbu72++MIrQMA3JhX74I3/eokba6OxBmp+F+mw==","signatures":[{"sig":"MEYCIQDWqf7xAZD8pDidV2tgQavJRw0SGi/GZOMXXAnoF0CJZwIhAKqjeUx5OCqaIhAqHOGN9HA9sJjPD1aNX/Ea1cv2sO7m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21699},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"62d830288eabbe74fa3c24aee1127f87e32cb082","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/wahyubucil/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.3_1723745536583_0.789852562435827","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.4","keywords":["nestjs","zod","openapi","swagger"],"author":{"url":"https://www.linkedin.com/in/wahyubucil","name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.4","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/wahyubucil/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/wahyubucil/nestjs-zod-openapi/issues"},"dist":{"shasum":"fe8c1d4e7a86bf45b8b26e9a97c922f9e45d4688","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.4.tgz","fileCount":12,"integrity":"sha512-8c5UC7BVUf7fdcxCU52gBk+i3YWeZTa0iBo53CfzZWAhoz677AM1h3MMj/P9ueDTQg7CEi4Eo5l4FmJBfKLk3w==","signatures":[{"sig":"MEUCIQDI5c8ZhSM9ieE/DqDTOG42VYvFPvIYKco7oLEGoCXAuwIgTjuzPDi2eP95FMR0b8jwyfA1u7tQ7fopGmtLBenSZJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21737},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"0ed25b5fd276ef7f39a4318b1191a1277222e335","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/wahyubucil/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.4_1723745977202_0.9715681420935818","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.5","keywords":["nestjs","zod","openapi","swagger"],"author":{"name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.5","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"dist":{"shasum":"971070888d4d3878327c58d6e9c1892eea668702","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.5.tgz","fileCount":12,"integrity":"sha512-5hmyHPynPZToFXviwcFBRPFstxRL3TyNDWO6GPBpmMZctZHQVLUgRT+d2dSS+/OkgBaG5+odcWaFpI0L44WDyg==","signatures":[{"sig":"MEQCIFevXpWiVzmpHqUShkd9PO1YNwvwG3DXHloEKNpeKUhLAiBPkogB6ruQpjgGLlX27je22wHwLsmm+Z6xAg/d6Wtznw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21682},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"e2c2d2f581c98c42f724048ded5b9e94555cc5da","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.5_1723746371677_0.8492789085802399","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.6","keywords":["nestjs","zod","openapi","swagger"],"author":{"name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.6","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"dist":{"shasum":"781454abeb05a71faeb77d7f3aff13e29d71f6d1","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.6.tgz","fileCount":12,"integrity":"sha512-ElBkzCvu1xfF765L0yYVkp9brIGC5pL7Emvy944m7mmzzLZylbZfR3Htry1RaQ2hxr/wWeXpzUNp9JKi1TkW+Q==","signatures":[{"sig":"MEYCIQDs+ckGIZk5mq1ZFvHye9m4sD3K8K9KQp+Eg7jyjDOhlgIhAKyhqbfdvfbMeRLMmShqrdS+B9Ig6y/S5bY4Ivn0O9j1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21925},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"934504495c44a3293b574f2c3d338093234bc223","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.6_1723752378427_0.19188196658251","host":"s3://npm-registry-packages"}},"0.1.7":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.7","keywords":["nestjs","zod","openapi","swagger"],"author":{"name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.7","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"dist":{"shasum":"558888399b1a60a976b53146877b9a95978574b3","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.7.tgz","fileCount":12,"integrity":"sha512-W90nB0SdxIQsQnuqTBm22LAv6wkBy9ffaym3tL5IjxcQPWw9XJvvL4ylVupsreNJXWIfnt7tx3hf+oWcOpHZqA==","signatures":[{"sig":"MEQCIGWSWFbY3Vchk5YJWHvxF1Vx4jNbLWF0/CTomUdlaPApAiAqelBf8eSsZUugmWJ8icJtr0WsYlkdhfqRcCcK9QJOHA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22073},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"41064515db483149e0654e99dbcacac57d10270a","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.7_1723752732304_0.23690128013543932","host":"s3://npm-registry-packages"}},"0.1.8":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.8","keywords":["nestjs","zod","openapi","swagger"],"author":{"name":"Wahyu Budi Saputra"},"license":"MIT","_id":"@anstatsig/nestjs-zod-openapi@0.1.8","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"dist":{"shasum":"4aed956b5d4ba30c8b58b5e15d62e83b9cd9f663","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.8.tgz","fileCount":12,"integrity":"sha512-AR+tlm4DiuveQybQFiqk2I+ypBcV2XV2jPCvfIcR7heG67FXuArIXJhzVT0yqkIgCkqAnoXUVTu8eSHUIFwTgA==","signatures":[{"sig":"MEQCIGFOmqsZpeeuANJe9AgQeo+YOhbFSh45A9KTf/uG30YeAiADYYjBL/VOyBy9+0aeF2IaYEqM5DSEayakoROE3DrxfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22090},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"gitHead":"61b791833e8877986e5051dbdbda34fca44f1f04","scripts":{"lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","build":"pnpm run build-fast --dts-resolve","release":"np --no-tests --message=\"chore(release): %s\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix","build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"repository":{"url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git","type":"git"},"_npmVersion":"10.5.2","description":"NestJS helper to easily use Zod with OpenAPI","directories":{},"_nodeVersion":"20.13.1","dependencies":{"openapi3-ts":"^4.1.2","@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","zod":"^3.22.4","tsup":"^7.2.0","eslint":"^8.52.0","prettier":"^3.0.3","eslint-kit":"^10.6.0","typescript":"^5.2.2","@types/node":"^20.8.10","@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14"},"peerDependencies":{"zod":"^3","@nestjs/common":"^10","@nestjs/swagger":"^7"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-zod-openapi_0.1.8_1723753291874_0.8221068158501885","host":"s3://npm-registry-packages"}},"0.1.9":{"name":"@anstatsig/nestjs-zod-openapi","version":"0.1.9","type":"module","description":"NestJS helper to easily use Zod with OpenAPI","license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git"},"homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","author":{"name":"Wahyu Budi Saputra"},"types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./boot":{"types":"./dist/boot.d.ts","import":"./dist/boot.js","require":"./dist/boot.cjs"}},"typesVersions":{"*":{"boot":["./dist/boot.d.ts"]}},"keywords":["nestjs","zod","openapi","swagger"],"engines":{"node":">=18"},"scripts":{"build-fast":"tsup src/index.ts src/boot.ts --format esm,cjs","build":"pnpm run build-fast --dts-resolve","prepublishOnly":"pnpm run build","release":"np --no-tests --message=\"chore(release): %s\"","lint":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\"","lint:fix":"eslint \"src/**/*.{js,mjs,cjs,ts,mts}\" --fix"},"dependencies":{"@anatine/zod-nestjs":"^2.0.3","@anatine/zod-openapi":"^2.2.0","@asteasolutions/zod-to-openapi":"^6.2.0","openapi3-ts":"^4.1.2"},"peerDependencies":{"@nestjs/common":"^10","@nestjs/swagger":"^7","zod":"^3"},"devDependencies":{"@nestjs/common":"^10.2.7","@nestjs/swagger":"^7.1.14","@types/node":"^20.8.10","eslint":"^8.52.0","eslint-kit":"^10.6.0","np":"^8.0.4","prettier":"^3.0.3","tsup":"^7.2.0","typescript":"^5.2.2","zod":"^3.22.4"},"_id":"@anstatsig/nestjs-zod-openapi@0.1.9","gitHead":"10fbaf12eaf993daf4a22057c00901bd19d26b13","bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-B1YDev1Bqt1d5yJFM+JxYkp0yqK/z8f4sGC+qSwa5XZWzBY3cay/RDfMSqJV+gPRHBu8RfhGLS87Pj91ntBnHA==","shasum":"ca6fd657a6eb9b701d9a8a72168a21b1f8db9eeb","tarball":"https://registry.npmjs.org/@anstatsig/nestjs-zod-openapi/-/nestjs-zod-openapi-0.1.9.tgz","fileCount":12,"unpackedSize":22394,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD54inz5y8Ks3cW0CgyjwIW0SK+Z4SEzrWS7tU8XpiMGQIhAJ6B814ozN++kWwMVQ4Oi6RTRTFTgK/5QciwFaX5LgGI"}]},"_npmUser":{"name":"anstatsig","email":"anle@statsig.com"},"directories":{},"maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-zod-openapi_0.1.9_1723767773059_0.16389137753440974"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-15T18:12:16.486Z","modified":"2024-08-16T00:22:53.417Z","0.1.3":"2024-08-15T18:12:16.749Z","0.1.4":"2024-08-15T18:19:37.442Z","0.1.5":"2024-08-15T18:26:11.963Z","0.1.6":"2024-08-15T20:06:18.615Z","0.1.7":"2024-08-15T20:12:12.455Z","0.1.8":"2024-08-15T20:21:32.042Z","0.1.9":"2024-08-16T00:22:53.247Z"},"bugs":{"url":"https://github.com/anstatsig/nestjs-zod-openapi/issues"},"author":{"name":"Wahyu Budi Saputra"},"license":"MIT","homepage":"https://github.com/anstatsig/nestjs-zod-openapi#readme","keywords":["nestjs","zod","openapi","swagger"],"repository":{"type":"git","url":"git+https://github.com/anstatsig/nestjs-zod-openapi.git"},"description":"NestJS helper to easily use Zod with OpenAPI","maintainers":[{"name":"anstatsig","email":"anle@statsig.com"}],"readme":"# NestJS Zod OpenAPI\n\n> NestJS helper to easily use Zod with OpenAPI\n\n[![npm-image]][npm-url] [![license-image]][license-url] [![typescript-image]][typescript-url]\n\nThis package is a combination of two awesome packages:\n\n- [@anatine/zod-nestjs](https://www.npmjs.com/package/@anatine/zod-nestjs): provide a validation pipe on data and helper methods to create DTO from a Zod schema.\n- [@asteasolutions/zod-to-openapi](https://www.npmjs.com/package/@asteasolutions/zod-to-openapi): provide `openapi` method to the Zod schema. The advantage of this package is the built-in schema reference, so when we have a nested schema, the OpenAPI documentation will reference the schema instead of just creating a plain new object.\n\nMost of the documentation here will be adopted from both of the packages. If something's missing here, please refer to each package's documentation. Thanks to both of the authors for making such awesome packages.\n\n## Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Set up your app](#set-up-your-app)\n  - [Using `ZodValidationPipe`](#using-zodvalidationpipe)\n  - [Generate a schema](#generate-a-schema)\n  - [Use the schema in controller](#use-the-schema-in-controller)\n\n## Installation\n\nMake sure you've set up the `@nestjs/swagger` module first. [Read it here](https://docs.nestjs.com/openapi/introduction).\n\nAfter set up is completed you can install this package and the [Zod][zod-url] package:\n\n```sh\n# NPM\nnpm i zod @wahyubucil/nestjs-zod-openapi\n# Yarn\nyarn add zod @wahyubucil/nestjs-zod-openapi\n# PNPM\npnpm add zod @wahyubucil/nestjs-zod-openapi\n```\n\nZod requires us to enable `strict` mode in your `tsconfig.json`.\n\n```json\n// tsconfig.json\n{\n  // ...\n  \"compilerOptions\": {\n    // ...\n    \"strict\": true\n  }\n}\n```\n\nExample `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"removeComments\": true,\n    \"emitDecoratorMetadata\": true,\n    \"experimentalDecorators\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"target\": \"ES2021\",\n    \"sourceMap\": true,\n    \"outDir\": \"./dist\",\n    \"baseUrl\": \"./\",\n    \"incremental\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true\n  }\n}\n```\n\n## Usage\n\n### Set up your app\n\n1. Make sure you load the `@wahyubucil/nestjs-zod-openapi/boot` script from this package at the top of the main script.\n2. Patch the swagger so that it can use Zod types before you create the document.\n\nExample Main App:\n\n```ts\nimport '@wahyubucil/nestjs-zod-openapi/boot' // <-- add this. The boot script should be on the top of this file.\n\nimport { NestFactory } from '@nestjs/core'\nimport { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'\nimport { patchNestjsSwagger } from '@wahyubucil/nestjs-zod-openapi' // <-- add this. Import the patch for NestJS Swagger\n\nimport { AppModule } from './app.module'\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule)\n\n  const config = new DocumentBuilder()\n    .setTitle('Example API')\n    .setDescription('The example API description')\n    .setVersion('1.0')\n    .build()\n\n  patchNestjsSwagger({ schemasSort: 'alpha' }) // <-- add this. This function should run before the `SwaggerModule.createDocument` function.\n\n  const document = SwaggerModule.createDocument(app, config)\n  SwaggerModule.setup('docs', app, document)\n\n  await app.listen(3000)\n}\nbootstrap()\n```\n\nThe `patchNestjsSwagger` contains an options:\n\n- `schemasSort`: to determine the sorting mechanism\n  - `default`: no special sorting mechanism, it's based on the schema declaration order.\n  - `alpha`: sorting based on the alpha-numeric order.\n  - `localeCompare`: using JavaScript `localeCompare` to sort the order, it will use each locale sorting mechanism.\n\n### Using `ZodValidationPipe`\n\nThere are two ways to do it:\n\n- Globally (recommended):\n\n```ts\n// app.module.ts\nimport { APP_PIPE } from '@nestjs/core'\nimport { ZodValidationPipe } from '@wahyubucil/nestjs-zod-openapi'\n\n@Module({\n  providers: [\n    {\n      provide: APP_PIPE,\n      useClass: ZodValidationPipe,\n    },\n  ],\n})\nexport class AppModule {}\n```\n\n- Locally\n\n```ts\n// cats.controller.ts\nimport { ZodValidationPipe } from '@wahyubucil/nestjs-zod-openapi'\n\n// controller-level\n@UsePipes(ZodValidationPipe)\nclass CatsController {}\n\nclass CatsController {\n  // route-level\n  @UsePipes(ZodValidationPipe)\n  async create() {}\n}\n```\n\n### Generate a schema\n\nUse [Zod][zod-url] to generate a schema.\n\nExample schema:\n\n```ts\n// cats.dto.ts\nimport { createZodDto } from '@wahyubucil/nestjs-zod-openapi'\nimport { z } from 'zod'\n\n// This will make a new Zod schema with the name 'User'\nexport const User = z\n  .object({\n    email: z.string(),\n    displayName: z\n      .string()\n      .openapi({ description: 'Display name of the user' }), // <-- using the `openapi` method to add additional info on the field\n  })\n  .openapi('User')\n\n// This will make a new Zod schema with the name 'CatShelter'\nexport const Shelter = z\n  .object({\n    name: z.string(),\n    address: z.string(),\n  })\n  .openapi('CatShelter', { description: 'Shelter information' }) // <-- using the `openapi` method to add additional info on the schema\n\n// Example DTO Schemas to be used on controller\nexport const Cat = z.object({\n  name: z.string(),\n  age: z.number(),\n  breed: z.string(),\n  shelter: Shelter,\n  createdBy: User,\n})\nexport class CatDto extends createZodDto(Cat) {}\n\nexport class UpdateCatDto extends createZodDto(\n  Cat.omit({ name: true, createdBy: true }),\n) {}\n\nexport const GetCats = z.object({\n  cats: z.array(z.string()),\n})\nexport class GetCatsDto extends createZodDto(GetCats) {}\n\nexport const CreateCatResponse = z.object({\n  success: z.boolean(),\n  message: z.string(),\n  name: z.string(),\n})\nexport class CreateCatResponseDto extends createZodDto(CreateCatResponse) {}\n\nexport class UpdateCatResponseDto extends createZodDto(\n  CreateCatResponse.omit({ name: true }),\n) {}\n```\n\n### Use the schema in controller\n\nThis follows the standard NestJS method of creating controllers.\n\n`@nestjs/swagger` decorators should work normally.\n\nExample Controller:\n\n```ts\n// cats.controller.ts\nimport { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'\nimport { ApiCreatedResponse, ApiOkResponse } from '@nestjs/swagger'\nimport {\n  CatDto,\n  CreateCatResponseDto,\n  GetCatsDto,\n  UpdateCatDto,\n  UpdateCatResponseDto,\n} from './cats.dto'\n\n@Controller('cats')\nexport class CatsController {\n  // Use DTO as the type-safety helper\n  @Get()\n  @ApiOkResponse({\n    type: GetCatsDto,\n  })\n  async findAll(): Promise<GetCatsDto> {\n    return { cats: ['Lizzie', 'Spike'] }\n  }\n\n  // If you want both runtime and type safety, we recommend to parse the schema directly instead of using it as a return type\n  @Get(':id')\n  @ApiOkResponse({\n    type: CatDto,\n  })\n  async findOne(@Param() { id }: { id: string }) {\n    return CatDto.zodSchema.parse({\n      name: `Cat-${id}`,\n      age: 8,\n      breed: 'Unknown',\n      shelter: {\n        name: 'A sample shelter',\n        address: 'Bali, Indonesia',\n      },\n      createdBy: {\n        email: 'email@example.com',\n        displayName: 'Wahyu Bucil',\n      },\n    })\n  }\n\n  @Post()\n  @ApiCreatedResponse({\n    description: 'The record has been successfully created.',\n    type: CreateCatResponseDto,\n  })\n  async create(@Body() createCatDto: CatDto) {\n    return CreateCatResponseDto.zodSchema.parse({\n      success: true,\n      message: 'Cat created',\n      name: createCatDto.name,\n    })\n  }\n\n  @Patch()\n  @ApiOkResponse({\n    type: UpdateCatDto,\n  })\n  async update(@Body() updateCatDto: UpdateCatDto) {\n    return UpdateCatResponseDto.zodSchema.parse({\n      success: true,\n      message: `Cat's age of ${updateCatDto.age} updated`,\n    })\n  }\n}\n```\n\nNOTE: You still need to explicitly define the response for the OpenAPI via the decorators provided by `@nestjs/swagger`.\n\n---\n\n<div align=\"center\">\n  <sub>Built with ❤︎ by <a href=\"https://twitter.com/wahyubucil\">Wahyu \"The GOAT\" Bucil</a>\n</div>\n\n[npm-image]: https://img.shields.io/npm/v/@wahyubucil/nestjs-zod-openapi.svg?style=for-the-badge&logo=npm\n[npm-url]: https://npmjs.org/package/@wahyubucil/nestjs-zod-openapi 'npm'\n[license-image]: https://img.shields.io/npm/l/@wahyubucil/nestjs-zod-openapi?color=blueviolet&style=for-the-badge\n[license-url]: LICENSE.md 'license'\n[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript\n[typescript-url]: \"typescript\"\n[zod-url]: https://github.com/colinhacks/zod\n","readmeFilename":"README.md"}