@kubb/plugin-zod 5.4.7 → 5.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2236,7 +2236,7 @@ var compatibility = {
2236
2236
  };
2237
2237
  //#endregion
2238
2238
  //#region package.json
2239
- var version = "5.4.7";
2239
+ var version = "5.4.9";
2240
2240
  //#endregion
2241
2241
  //#region src/resolvers/resolverZod.ts
2242
2242
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
- import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ResolverPatch, ast } from "kubb/kit";
2
+ import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverPatch, ast } from "kubb/kit";
3
3
  import { AdapterOas } from "@kubb/adapter-oas";
4
4
  //#region src/printers/printerZod.d.ts
5
5
  /**
@@ -483,7 +483,7 @@ type ResolvedOptions = {
483
483
  typeGuards: NonNullable<Options['typeGuards']>;
484
484
  printer: Options['printer'];
485
485
  };
486
- type PluginZod = PluginFactoryOptions<'plugin-zod', Options, ResolvedOptions, ResolverZod>;
486
+ type PluginZod = PluginType<'plugin-zod', Options, ResolvedOptions, ResolverZod>;
487
487
  declare global {
488
488
  namespace Kubb {
489
489
  interface PluginRegistry {
package/dist/index.js CHANGED
@@ -2226,7 +2226,7 @@ var compatibility = {
2226
2226
  };
2227
2227
  //#endregion
2228
2228
  //#region package.json
2229
- var version = "5.4.7";
2229
+ var version = "5.4.9";
2230
2230
  //#endregion
2231
2231
  //#region src/resolvers/resolverZod.ts
2232
2232
  /**
package/docs/overview.md CHANGED
@@ -1,26 +1,31 @@
1
1
  # Zod
2
2
 
3
- Generates Zod v4 schemas from your OpenAPI spec. Use them to validate API responses, form input, and query params at runtime.
3
+ The Zod plugin generates a Zod v4 schema for every schema in your OpenAPI spec.
4
4
 
5
- The schemas need no other plugin. With `inferred: true`, the plugin also exports a `z.infer` type next to each schema, so you can skip `@kubb/plugin-ts`. Client plugins such as `@kubb/plugin-fetch` and `@kubb/plugin-axios` use these schemas when you set their `validator` option.
5
+ The client plugins `@kubb/plugin-fetch`, `@kubb/plugin-axios`, and `@kubb/plugin-client` use these schemas when you set their `validator` option.
6
6
 
7
7
  ## Setup
8
8
 
9
- Install Zod v4 or higher in the app that uses the generated code. No other plugins are needed.
9
+ - No other plugins are needed.
10
+ - Install `zod` v4 in the app that uses the generated code. `compile` needs 4.5 or later, and `typeGuards` needs 4.6 or later.
10
11
 
11
12
  ## Options worth knowing
12
13
 
13
- - `mini` generates Zod Mini schemas for smaller bundles, and switches `importPath` to `zod/mini`.
14
- - `importPath` sets the module the files import `z` from. The default is `zod`.
15
- - `inferred` exports a `z.infer` type alias next to each schema.
14
+ - `mini` (beta) generates Zod Mini schemas for smaller bundles, and switches `importPath` to `zod/mini`.
15
+ - `importPath` sets the module the generated files import `z` from. The default is `zod`.
16
+ - `inferred` adds a `z.infer` type next to each schema, so you can skip `@kubb/plugin-ts`.
16
17
  - `coercion` wraps schemas in `z.coerce`, so input is converted before validation. Pass an object to coerce only dates, strings, or numbers.
17
18
  - `guidType` picks `z.uuid()` (default) or `z.guid()` for `format: uuid`.
18
19
  - `regexType` writes a `pattern` as a regex literal (default) or a `RegExp` constructor.
19
20
  - `typeGuards` adds `is*` type guards and `assert*` assertions.
20
- - `compile` wraps schemas in `z.compile` for faster validation.
21
+ - `compile` wraps schemas in `z.compile` for faster validation. Circular schemas are left as they are.
22
+
23
+ See [Options](https://kubb.dev/extensions/kubb-labs/plugin-zod/options) for every option and its default.
21
24
 
22
25
  ## Example
23
26
 
27
+ The config below generates the schemas with a `z.infer` type next to each one.
28
+
24
29
  ```typescript [kubb.config.ts]
25
30
  import { defineConfig } from 'kubb/config'
26
31
  import { pluginZod } from '@kubb/plugin-zod'
@@ -33,8 +38,3 @@ export default defineConfig({
33
38
  ],
34
39
  })
35
40
  ```
36
-
37
- ## See also
38
-
39
- - [Zod](https://zod.dev/)
40
- - [Zod Mini](https://zod.dev/packages/mini)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-zod",
3
- "version": "5.4.7",
3
+ "version": "5.4.9",
4
4
  "description": "Generate Zod validation schemas with Kubb for runtime data parsing and type safety. Pairs with @kubb/plugin-ts for end-to-end type coverage.",
5
5
  "keywords": [
6
6
  "code-generation",
@@ -66,11 +66,11 @@
66
66
  "devDependencies": {
67
67
  "@internals/shared": "0.0.0",
68
68
  "@internals/utils": "0.0.0",
69
- "kubb": "^5.8.3",
69
+ "kubb": "^5.9.2",
70
70
  "zod": "^4.6.5"
71
71
  },
72
72
  "peerDependencies": {
73
- "kubb": "^5.8.3",
73
+ "kubb": "^5.9.2",
74
74
  "zod": "^4.0.0"
75
75
  },
76
76
  "peerDependenciesMeta": {