{"id":17457571,"url":"https://github.com/BenLorantfy/nestjs-zod","last_synced_at":"2025-03-02T11:30:55.209Z","repository":{"id":40738054,"uuid":"492078768","full_name":"BenLorantfy/nestjs-zod","owner":"BenLorantfy","description":"All NestJS + Zod utilities you need","archived":false,"fork":false,"pushed_at":"2025-02-16T00:05:56.000Z","size":534,"stargazers_count":642,"open_issues_count":16,"forks_count":67,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-27T13:39:34.277Z","etag":null,"topics":["javascript","nest","nestjs","node","nodejs","openapi","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenLorantfy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-14T00:58:26.000Z","updated_at":"2025-02-27T04:02:04.000Z","dependencies_parsed_at":"2024-01-14T04:44:17.695Z","dependency_job_id":"118c9deb-c53b-4f9f-85f4-782894846847","html_url":"https://github.com/BenLorantfy/nestjs-zod","commit_stats":{"total_commits":112,"total_committers":17,"mean_commits":6.588235294117647,"dds":0.3125,"last_synced_commit":"8e8d515f61353dcfb92aae030c155d3ea30faa1f"},"previous_names":["risen228/nestjs-zod","risenforces/nestjs-zod","benlorantfy/nestjs-zod"],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenLorantfy%2Fnestjs-zod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenLorantfy%2Fnestjs-zod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenLorantfy%2Fnestjs-zod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenLorantfy%2Fnestjs-zod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenLorantfy","download_url":"https://codeload.github.com/BenLorantfy/nestjs-zod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241500968,"owners_count":19972786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","nest","nestjs","node","nodejs","openapi","typescript","zod"],"created_at":"2024-10-18T03:01:16.791Z","updated_at":"2025-03-02T11:30:55.201Z","avatar_url":"https://github.com/BenLorantfy.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.svg\" width=\"560px\" align=\"center\" alt=\"NestJS + Zod logo\" style=\"max-width: 100%;\" /\u003e\n  \u003ch1\u003e\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    ✨ A seamless validation solution for your NestJS application ✨\n  \u003c/p\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/BenLorantfy/nestjs-zod/actions?query=branch%3Amain\"\u003e\n    \u003cimg src=\"https://github.com/BenLorantfy/nestjs-zod/actions/workflows/test-and-build.yml/badge.svg?event=push\u0026branch=main\" alt=\"nestjs-zod CI Status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/BenLorantfy/nestjs-zod\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-zod\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dw/nestjs-zod.svg\" alt=\"npm\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nestjs-zod\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/BenLorantfy/nestjs-zod\" alt=\"stars\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Core library features\n\n- `createZodDto` - create DTO classes from Zod schemas\n- `ZodValidationPipe` - validate `body` / `query` / `params` using Zod DTOs\n- `ZodGuard` - guard routes by validating `body` / `query` / `params`  \n  (it can be useful when you want to do that before other guards)\n- `UseZodGuard` - alias for `@UseGuards(new ZodGuard(source, schema))`\n- `ZodValidationException` - BadRequestException extended with Zod errors\n- `zodToOpenAPI` - create OpenAPI declarations from Zod schemas\n- OpenAPI support\n  - `@nestjs/swagger` integration using the patch\n  - `zodToOpenAPI` - generate highly accurate Swagger Schema\n  - Zod DTOs can be used in any `@nestjs/swagger` decorator\n- Extended Zod schemas for NestJS (`@nest-zod/z`)\n  - **Note:** _`@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information._\n  - `dateString` for dates (supports casting to `Date`)\n  - `password` for passwords (more complex string rules + OpenAPI conversion)\n- Customization - change exception format easily\n- Useful helpers for client side error handling (`nestjs-zod/frontend`)\n\n## Installation\n\n```\nnpm install nestjs-zod zod\n```\n\nPeer dependencies:\n\n- `zod` - `\u003e= 3.14.3`\n- `@nestjs/common` - `\u003e= 8.0.0` (required on server side)\n- `@nestjs/core` - `\u003e= 8.0.0` (required on server side)\n- `@nestjs/swagger` - `\u003e= 5.0.0` (only when using `patchNestJsSwagger`)\n\nAll peer dependencies are marked as optional for better client side usage, but you need to install required ones when using `nestjs-zod` on server side.\n\n## Navigation\n\n- [Creating DTO from Zod schema](#creating-dto-from-zod-schema)\n  - [Using DTO](#using-dto)\n- [Using ZodValidationPipe](#using-zodvalidationpipe)\n  - [Globally](#globally-recommended)\n  - [Locally](#locally)\n  - [Creating custom validation pipe](#creating-custom-validation-pipe)\n- [Using ZodGuard](#using-zodguard)\n  - [Creating custom guard](#creating-custom-guard)\n- [Validation Exceptions](#validation-exceptions)\n- [Using ZodSerializerInterceptor](#using-zodserializerinterceptor-for-output-validation)\n- [Extended Zod](#extended-zod)\n  - [ZodDateString](#zoddatestring)\n  - [ZodPassword](#zodpassword)\n  - [Json Schema](#json-schema)\n  - [\"from\" function](#from-function)\n  - [Extended Zod Errors](#extended-zod-errors)\n  - [Working with errors on the client side](#working-with-errors-on-the-client-side)\n- [OpenAPI (Swagger) support](#openapi-swagger-support)\n  - [Setup](#setup)\n  - [Writing more Swagger-compatible schemas](#writing-more-swagger-compatible-schemas)\n  - [Using zodToOpenAPI](#using-zodtoopenapi)\n\n## Creating DTO from Zod schema\n\n```ts\nimport { createZodDto } from 'nestjs-zod'\nimport { z } from 'zod'\n\nconst CredentialsSchema = z.object({\n  username: z.string(),\n  password: z.string(),\n})\n\n// class is required for using DTO as a type\nclass CredentialsDto extends createZodDto(CredentialsSchema) {}\n```\n\n### Using DTO\n\nDTO does two things:\n\n- Provides a schema for `ZodValidationPipe`\n- Provides a type from Zod schema for you\n\n```ts\n@Controller('auth')\nclass AuthController {\n  // with global ZodValidationPipe (recommended)\n  async signIn(@Body() credentials: CredentialsDto) {}\n  async signIn(@Param() signInParams: SignInParamsDto) {}\n  async signIn(@Query() signInQuery: SignInQueryDto) {}\n\n  // with route-level ZodValidationPipe\n  @UsePipes(ZodValidationPipe)\n  async signIn(@Body() credentials: CredentialsDto) {}\n}\n\n// with controller-level ZodValidationPipe\n@UsePipes(ZodValidationPipe)\n@Controller('auth')\nclass AuthController {\n  async signIn(@Body() credentials: CredentialsDto) {}\n}\n```\n\n### Using standalone (without server-side dependencies)\n\n```ts\nimport { createZodDto } from 'nestjs-zod/dto'\n```\n\n## Using ZodValidationPipe\n\nThe validation pipe uses your Zod schema to parse data from parameter decorator.\n\nWhen the data is invalid - it throws [ZodValidationException](#validation-exceptions).\n\n### Globally (recommended)\n\n```ts\nimport { ZodValidationPipe } from 'nestjs-zod'\nimport { APP_PIPE } from '@nestjs/core'\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\nimport { ZodValidationPipe } from 'nestjs-zod'\n\n// controller-level\n@UsePipes(ZodValidationPipe)\nclass AuthController {}\n\nclass AuthController {\n  // route-level\n  @UsePipes(ZodValidationPipe)\n  async signIn() {}\n}\n```\n\nAlso, you can instantly pass a Schema or DTO:\n\n```ts\nimport { ZodValidationPipe } from 'nestjs-zod'\nimport { UserDto, UserSchema } from './auth.contracts'\n\n// using schema\n@UsePipes(new ZodValidationPipe(UserSchema))\n// using DTO\n@UsePipes(new ZodValidationPipe(UserDto))\nclass AuthController {}\n\nclass AuthController {\n  // the same applies to route-level\n  async signIn() {}\n}\n```\n\n### Creating custom validation pipe\n\n```ts\nimport { createZodValidationPipe } from 'nestjs-zod'\n\nconst MyZodValidationPipe = createZodValidationPipe({\n  // provide custom validation exception factory\n  createValidationException: (error: ZodError) =\u003e\n    new BadRequestException('Ooops'),\n})\n```\n\n## Using ZodGuard\n\nSometimes, we need to validate user input before specific Guards. We can't use Validation Pipe since NestJS Pipes are always executed after Guards.\n\nThe solution is `ZodGuard`. It works just like `ZodValidationPipe`, except for that is doesn't transform the input.\n\nIt has 2 syntax forms:\n\n- `@UseGuards(new ZodGuard('body', CredentialsSchema))`\n- `@UseZodGuard('body', CredentialsSchema)`\n\nParameters:\n\n1. The source - `'body' | 'query' | 'params'`\n2. Zod Schema or DTO (just like `ZodValidationPipe`)\n\nWhen the data is invalid - it throws [ZodValidationException](#validation-exceptions).\n\n```ts\nimport { ZodGuard } from 'nestjs-zod'\n\n// controller-level\n@UseZodGuard('body', CredentialsSchema)\n@UseZodGuard('params', CredentialsDto)\nclass MyController {}\n\nclass MyController {\n  // route-level\n  @UseZodGuard('query', CredentialsSchema)\n  @UseZodGuard('body', CredentialsDto)\n  async signIn() {}\n}\n```\n\n### Creating custom guard\n\n```ts\nimport { createZodGuard } from 'nestjs-zod'\n\nconst MyZodGuard = createZodGuard({\n  // provide custom validation exception factory\n  createValidationException: (error: ZodError) =\u003e\n    new BadRequestException('Ooops'),\n})\n```\n\n## Create validation from scratch\n\nIf you don't like `ZodGuard` and `ZodValidationPipe`, you can use `validate` function:\n\n```ts\nimport { validate } from 'nestjs-zod'\n\nvalidate(wrongThing, UserDto, (zodError) =\u003e new MyException(zodError)) // throws MyException\n\nconst validatedUser = validate(\n  user,\n  UserDto,\n  (zodError) =\u003e new MyException(zodError)\n) // returns typed value when succeed\n```\n\n## Validation Exceptions\n\nThe default server response on validation error looks like that:\n\n```json\n{\n  \"statusCode\": 400,\n  \"message\": \"Validation failed\",\n  \"errors\": [\n    {\n      \"code\": \"too_small\",\n      \"minimum\": 8,\n      \"type\": \"string\",\n      \"inclusive\": true,\n      \"message\": \"String must contain at least 8 character(s)\",\n      \"path\": [\"password\"]\n    }\n  ]\n}\n```\n\nThe reason of this structure is default `ZodValidationException`.\n\nYou can customize the exception by creating custom `nestjs-zod` entities using the factories:\n\n- [Validation Pipe](#creating-custom-validation-pipe)\n- [Guard](#creating-custom-guard)\n\nYou can create `ZodValidationException` manually by providing `ZodError`:\n\n```ts\nconst exception = new ZodValidationException(error)\n```\n\nAlso, `ZodValidationException` has an additional API for better usage in NestJS Exception Filters:\n\n```ts\n@Catch(ZodValidationException)\nexport class ZodValidationExceptionFilter implements ExceptionFilter {\n  catch(exception: ZodValidationException) {\n    exception.getZodError() // -\u003e ZodError\n  }\n}\n```\n\n## Using ZodSerializerInterceptor for output validation\n\nTo ensure that a response conforms to a certain shape, you may use the `ZodSerializerInterceptor` interceptor.\n\nThis would be especially useful in prevent accidental data leaks.\n\nThis is similar to NestJs' `@ClassSerializerInterceptor` feature [here](https://docs.nestjs.com/techniques/serialization)\n\n### Include `@ZodSerializerInterceptor` in application root\n\n```ts\n@Module({\n  ...\n  providers: [\n    ...,\n    { provide: APP_INTERCEPTOR, useClass: ZodSerializerInterceptor },\n  ],\n})\nexport class AppModule {}\n```\n\n### Use `@ZodSerializerDto` to define the shape of the response for endpoint in controller\n\n```ts\nconst UserSchema = z.object({ username: string() })\n\nexport class UserDto extends createZodDto(UserSchema) {}\n```\n\n```ts\n@Controller('user')\nexport class UserController {\n  constructor(private readonly userService: UserService) {}\n\n  @ZodSerializerDto(UserDto)\n  getUser(id: number) {\n    return this.userService.findOne(id) // --\u003e The native service method returns { username: string, password: string by default }\n  }\n}\n```\n\nIn the above example, despite the `userService.findOne` method returns `password`, the `password` property will be stripped out thanks to the `@ZodSerializerDto` decorator.\n\n### Logging serialization errors using `ZodSerializationException` \n\nYou can catch serialization errors using `ZodSerializationException` and log them using your preferred logger.\n\n```ts\nif (exception instanceof ZodSerializationException) {\n    const zodError = exception.getZodError();\n    this.logger.error(`ZodSerializationException: ${zodError.message}`);\n}\n```\nSee the example app [here](/packages/example/src/http-exception.filter.ts) for more information.\n\n## Extended Zod\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\n`@nest-zod/z` provides a special version of Zod. It helps you to validate the user input more accurately by using our custom schemas and methods.\n\n### ZodDateString\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\nIn HTTP, we always accept Dates as strings. But default Zod only has validations for full date-time strings. `ZodDateString` was created to address this issue.\n\n```ts\n// 1. Expect user input to be a \"string\" type\n// 2. Expect user input to be a valid date (by using new Date)\nz.dateString()\n\n// Cast to Date instance\n// (use it on end of the chain, but before \"describe\")\nz.dateString().cast()\n\n// Expect string in \"full-date\" format from RFC3339\nz.dateString().format('date')\n\n// [default format]\n// Expect string in \"date-time\" format from RFC3339\nz.dateString().format('date-time')\n\n// Expect date to be the past\nz.dateString().past()\n\n// Expect date to be the future\nz.dateString().future()\n\n// Expect year to be greater or equal to 2000\nz.dateString().minYear(2000)\n\n// Expect year to be less or equal to 2025\nz.dateString().maxYear(2025)\n\n// Expect day to be a week day\nz.dateString().weekDay()\n\n// Expect year to be a weekend\nz.dateString().weekend()\n```\n\nValid `date` format examples:\n\n- `2022-05-15`\n\nValid `date-time` format examples:\n\n- `2022-05-02:08:33Z`\n- `2022-05-02:08:33.000Z`\n- `2022-05-02:08:33+00:00`\n- `2022-05-02:08:33-00:00`\n- `2022-05-02:08:33.000+00:00`\n\nErrors:\n\n- `invalid_date_string` - invalid date\n\n- `invalid_date_string_format` - wrong format\n\n  Payload:\n\n  - `expected` - `'date' | 'date-time'`\n\n- `invalid_date_string_direction` - not past/future\n\n  Payload:\n\n  - `expected` - `'past' | 'future'`\n\n- `invalid_date_string_day` - not weekDay/weekend\n\n  Payload:\n\n  - `expected` - `'weekDay' | 'weekend'`\n\n- `too_small` with `type === 'date_string_year'`\n- `too_big` with `type === 'date_string_year'`\n\n### ZodPassword\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\n`ZodPassword` is a string-like type, just like the `ZodDateString`. As you might have guessed, it's intended to help you with password schemas definition.\n\nAlso, `ZodPassword` has a more accurate OpenAPI conversion, comparing to regular `.string()`: it has `password` format and generated RegExp string for `pattern`.\n\n```ts\n// Expect user input to be a \"string\" type\nz.password()\n\n// Expect password length to be greater or equal to 8\nz.password().min(8)\n\n// Expect password length to be less or equal to 100\nz.password().max(100)\n\n// Expect password to have at least one digit\nz.password().atLeastOne('digit')\n\n// Expect password to have at least one lowercase letter\nz.password().atLeastOne('lowercase')\n\n// Expect password to have at least one uppercase letter\nz.password().atLeastOne('uppercase')\n\n// Expect password to have at least one special symbol\nz.password().atLeastOne('special')\n```\n\nErrors:\n\n- `invalid_password_no_digit`\n- `invalid_password_no_lowercase`\n- `invalid_password_no_uppercase`\n- `invalid_password_no_special`\n- `too_small` with `type === 'password'`\n- `too_big` with `type === 'password'`\n\n### Json Schema\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\n\u003e Created for `nestjs-zod-prisma`\n\n```ts\nz.json()\n```\n\n### \"from\" function\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\n\u003e Created for custom schemas in `nestjs-zod-prisma`\n\nJust returns the same Schema\n\n```ts\nz.from(MySchema)\n```\n\n### Extended Zod Errors\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\nCurrently, we use `custom` error code due to some Zod limitations (`errorMap` priorities)\n\nTherefore, the error details is located inside `params` property:\n\n```ts\nconst error = {\n  code: 'custom',\n  message: 'Invalid date, expected it to be the past',\n  params: {\n    isNestJsZod: true,\n    code: 'invalid_date_string_direction',\n\n    // payload is always located here in a flat view\n    expected: 'past',\n  },\n  path: ['date'],\n}\n```\n\n### Working with errors on the client side\n\n\u003e [!CAUTION]\n\u003e `@nest-zod/z/frontend` is deprecated and will not be supported soon.  It is recommended to use `zod` directly.  See [MIGRATION.md](./MIGRATION.md) for more information.\n\n\nOptionally, you can install `@nest-zod/z` on the client side.\n\nThe library provides you a `@nest-zod/z/frontend` entry point, that can be used to detect custom NestJS Zod issues and process them the way you want.\n\n```ts\nimport { isNestJsZodIssue, NestJsZodIssue, ZodIssue } from '@nest-zod/z/frontend'\n\nfunction mapToFormErrors(issues: ZodIssue[]) {\n  for (const issue of issues) {\n    if (isNestJsZodIssue(issue)) {\n      // issue is NestJsZodIssue\n    }\n  }\n}\n```\n\n\u003e :warning: **If you use `zod` in your client-side application, and you want to install `@nest-zod/z` too, it may be better to completely switch to `@nest-zod/z` to prevent issues caused by mismatch between `zod` versions. `@nest-zod/z/frontend` doesn't use `zod` at the runtime, but it uses its types.**\n\n## OpenAPI (Swagger) support\n\n### Setup\n\nPrerequisites:\n\n- `@nestjs/swagger` with version `^5.0.0` installed\n\nApply the patch `patchNestJsSwagger()` in your `main.ts` file before setting up your swagger module:\n\n```ts\nimport { patchNestJsSwagger } from 'nestjs-zod'\n\npatchNestJsSwagger()\n```\n\nFor addtional documentation, follow the [Nest.js' Swagger Module Guide](https://docs.nestjs.com/openapi/introduction), or you can see the example application guide [here](/packages/example/) .\n\n### Writing more Swagger-compatible schemas\n\nUse `.describe()` method to add Swagger description:\n\n```ts\nimport { z } from 'zod'\n\nconst CredentialsSchema = z.object({\n  username: z.string().describe('This is an username'),\n  password: z.string().describe('This is a password'),\n})\n```\n\n### Using zodToOpenAPI\n\nYou can convert any Zod schema to an OpenAPI JSON object:\n\n```ts\nimport { zodToOpenAPI } from 'nestjs-zod'\nimport { z } from 'zod'\n\nconst SignUpSchema = z.object({\n  username: z.string().min(8).max(20),\n  password: z.string().min(8).max(20),\n  sex: z\n    .enum(['male', 'female', 'nonbinary'])\n    .describe('We respect your gender choice'),\n  social: z.record(z.string().url())\n})\n\nconst openapi = zodToOpenAPI(SignUpSchema)\n```\n\nThe output will be the following:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"username\": {\n      \"type\": \"string\",\n      \"minLength\": 8,\n      \"maxLength\": 20\n    },\n    \"password\": {\n      \"type\": \"string\",\n      \"minLength\": 8,\n      \"maxLength\": 20\n    },\n    \"sex\": {\n      \"description\": \"We respect your gender choice\",\n      \"type\": \"string\",\n      \"enum\": [\"male\", \"female\", \"nonbinary\"]\n    },\n    \"social\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"type\": \"string\",\n        \"format\": \"uri\"\n      }\n    },\n    \"birthDate\": {\n      \"type\": \"string\",\n      \"format\": \"date-time\"\n    }\n  },\n  \"required\": [\"username\", \"password\", \"sex\", \"social\", \"birthDate\"]\n}\n```\n\n## Credits\n\n- [zod-dto](https://github.com/kbkk/abitia/tree/master/packages/zod-dto)  \n  `nestjs-zod` includes a lot of refactored code from `zod-dto`.\n\n- [zod-nestjs](https://github.com/anatine/zod-plugins/blob/main/packages/zod-nestjs/README.md) and [zod-openapi](https://github.com/anatine/zod-plugins/tree/main/packages/zod-openapi)  \n  These libraries bring some new features compared to `zod-dto`.  \n  `nestjs-zod` has used them too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBenLorantfy%2Fnestjs-zod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBenLorantfy%2Fnestjs-zod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBenLorantfy%2Fnestjs-zod/lists"}