From e9cc932eabdb336db904844816b6db55239c4ec0 Mon Sep 17 00:00:00 2001 From: samchungy Date: Tue, 23 Apr 2024 23:35:07 +1000 Subject: [PATCH] Prettier --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0f0c3c8..1b879df 100644 --- a/README.md +++ b/README.md @@ -34,25 +34,26 @@ pnpm install zod zod-openapi This mutates Zod to add an extra `.openapi()` method. Call this at the top of your entry point(s). You can achieve this in two differernt ways, depending on your preference. #### Subpath Import - - ```ts - import 'zod-openapi/extend'; - import { z } from 'zod'; - z.string().openapi({ description: 'hello world!', example: 'hello world' }); - ``` +```ts +import 'zod-openapi/extend'; +import { z } from 'zod'; + +z.string().openapi({ description: 'hello world!', example: 'hello world' }); +``` + #### Manual Extension - - This is useful if you have a different instance of Zod from another library that you would like to extend. - ```typescript - import { z } from 'another-lib'; - import { extendZodWithOpenApi } from 'zod-openapi'; +This is useful if you have a different instance of Zod from another library that you would like to extend. + +```typescript +import { z } from 'another-lib'; +import { extendZodWithOpenApi } from 'zod-openapi'; - extendZodWithOpenApi(z); +extendZodWithOpenApi(z); - z.string().openapi({ description: 'hello world!', example: 'hello world' }); - ``` +z.string().openapi({ description: 'hello world!', example: 'hello world' }); +``` #### `.openapi()`