@kubb/plugin-zod 3.0.0-alpha.16 → 3.0.0-alpha.18

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.
Files changed (49) hide show
  1. package/README.md +0 -4
  2. package/dist/{chunk-3ADOATRR.cjs → chunk-G5M2ERLS.cjs} +4 -4
  3. package/dist/{chunk-3ADOATRR.cjs.map → chunk-G5M2ERLS.cjs.map} +1 -1
  4. package/dist/{chunk-UVSNNADM.js → chunk-UPICPEOA.js} +4 -4
  5. package/dist/{chunk-UVSNNADM.js.map → chunk-UPICPEOA.js.map} +1 -1
  6. package/dist/{chunk-MUVEONQQ.js → chunk-Y7E62IFJ.js} +3 -3
  7. package/dist/{chunk-MUVEONQQ.js.map → chunk-Y7E62IFJ.js.map} +1 -1
  8. package/dist/{chunk-SWB2EKY4.cjs → chunk-ZVLPHBJB.cjs} +26 -26
  9. package/dist/{chunk-SWB2EKY4.cjs.map → chunk-ZVLPHBJB.cjs.map} +1 -1
  10. package/dist/components.cjs +3 -3
  11. package/dist/components.js +1 -1
  12. package/dist/generators.cjs +4 -4
  13. package/dist/generators.js +2 -2
  14. package/dist/index.cjs +5 -5
  15. package/dist/index.js +2 -2
  16. package/package.json +10 -15
  17. package/src/generators/__snapshots__/anyof.ts +2 -2
  18. package/src/generators/__snapshots__/createPet.ts +7 -7
  19. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +7 -7
  20. package/src/generators/__snapshots__/deletePet.ts +2 -2
  21. package/src/generators/__snapshots__/enumNamesType.ts +2 -2
  22. package/src/generators/__snapshots__/enumNullable.ts +2 -2
  23. package/src/generators/__snapshots__/enumVarNamesType.ts +2 -2
  24. package/src/generators/__snapshots__/example.ts +2 -2
  25. package/src/generators/__snapshots__/getPets.ts +8 -8
  26. package/src/generators/__snapshots__/mixedValueTypeConst.ts +3 -3
  27. package/src/generators/__snapshots__/nullableString.ts +2 -2
  28. package/src/generators/__snapshots__/nullableStringUuid.ts +2 -2
  29. package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +2 -2
  30. package/src/generators/__snapshots__/numberValueConst.ts +3 -3
  31. package/src/generators/__snapshots__/oneof.ts +2 -2
  32. package/src/generators/__snapshots__/operations.ts +44 -58
  33. package/src/generators/__snapshots__/optionalPetInfer.ts +3 -3
  34. package/src/generators/__snapshots__/optionalPetTyped.ts +2 -2
  35. package/src/generators/__snapshots__/order.ts +2 -9
  36. package/src/generators/__snapshots__/orderDateTypeFalse.ts +2 -9
  37. package/src/generators/__snapshots__/orderDateTypeString.ts +2 -9
  38. package/src/generators/__snapshots__/pet.ts +2 -2
  39. package/src/generators/__snapshots__/petArray.ts +3 -7
  40. package/src/generators/__snapshots__/petCoercion.ts +2 -7
  41. package/src/generators/__snapshots__/petTupleObject.ts +3 -3
  42. package/src/generators/__snapshots__/petWithMapper.ts +2 -2
  43. package/src/generators/__snapshots__/pets.ts +2 -2
  44. package/src/generators/__snapshots__/recursive.ts +2 -2
  45. package/src/generators/__snapshots__/showPetById.ts +8 -11
  46. package/src/generators/__snapshots__/stringValueConst.ts +3 -3
  47. package/src/generators/__snapshots__/uuidSchema.ts +2 -2
  48. package/src/parser/index.ts +1 -1
  49. package/src/types.ts +0 -5
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunk3ADOATRR_cjs = require('./chunk-3ADOATRR.cjs');
3
+ var chunkG5M2ERLS_cjs = require('./chunk-G5M2ERLS.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Operations", {
8
8
  enumerable: true,
9
- get: function () { return chunk3ADOATRR_cjs.Operations; }
9
+ get: function () { return chunkG5M2ERLS_cjs.Operations; }
10
10
  });
11
11
  Object.defineProperty(exports, "Zod", {
12
12
  enumerable: true,
13
- get: function () { return chunk3ADOATRR_cjs.Zod; }
13
+ get: function () { return chunkG5M2ERLS_cjs.Zod; }
14
14
  });
15
15
  //# sourceMappingURL=components.cjs.map
16
16
  //# sourceMappingURL=components.cjs.map
@@ -1,3 +1,3 @@
1
- export { Operations, Zod } from './chunk-UVSNNADM.js';
1
+ export { Operations, Zod } from './chunk-UPICPEOA.js';
2
2
  //# sourceMappingURL=components.js.map
3
3
  //# sourceMappingURL=components.js.map
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkSWB2EKY4_cjs = require('./chunk-SWB2EKY4.cjs');
4
- require('./chunk-3ADOATRR.cjs');
3
+ var chunkZVLPHBJB_cjs = require('./chunk-ZVLPHBJB.cjs');
4
+ require('./chunk-G5M2ERLS.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "operationsGenerator", {
9
9
  enumerable: true,
10
- get: function () { return chunkSWB2EKY4_cjs.operationsGenerator; }
10
+ get: function () { return chunkZVLPHBJB_cjs.operationsGenerator; }
11
11
  });
12
12
  Object.defineProperty(exports, "zodGenerator", {
13
13
  enumerable: true,
14
- get: function () { return chunkSWB2EKY4_cjs.zodGenerator; }
14
+ get: function () { return chunkZVLPHBJB_cjs.zodGenerator; }
15
15
  });
16
16
  //# sourceMappingURL=generators.cjs.map
17
17
  //# sourceMappingURL=generators.cjs.map
@@ -1,4 +1,4 @@
1
- export { operationsGenerator, zodGenerator } from './chunk-MUVEONQQ.js';
2
- import './chunk-UVSNNADM.js';
1
+ export { operationsGenerator, zodGenerator } from './chunk-Y7E62IFJ.js';
2
+ import './chunk-UPICPEOA.js';
3
3
  //# sourceMappingURL=generators.js.map
4
4
  //# sourceMappingURL=generators.js.map
package/dist/index.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkSWB2EKY4_cjs = require('./chunk-SWB2EKY4.cjs');
4
- var chunk3ADOATRR_cjs = require('./chunk-3ADOATRR.cjs');
3
+ var chunkZVLPHBJB_cjs = require('./chunk-ZVLPHBJB.cjs');
4
+ var chunkG5M2ERLS_cjs = require('./chunk-G5M2ERLS.cjs');
5
5
 
6
6
  // src/index.ts
7
- chunk3ADOATRR_cjs.init_cjs_shims();
7
+ chunkG5M2ERLS_cjs.init_cjs_shims();
8
8
 
9
9
  Object.defineProperty(exports, "pluginZod", {
10
10
  enumerable: true,
11
- get: function () { return chunkSWB2EKY4_cjs.pluginZod; }
11
+ get: function () { return chunkZVLPHBJB_cjs.pluginZod; }
12
12
  });
13
13
  Object.defineProperty(exports, "pluginZodName", {
14
14
  enumerable: true,
15
- get: function () { return chunkSWB2EKY4_cjs.pluginZodName; }
15
+ get: function () { return chunkZVLPHBJB_cjs.pluginZodName; }
16
16
  });
17
17
  //# sourceMappingURL=index.cjs.map
18
18
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { pluginZod, pluginZodName } from './chunk-MUVEONQQ.js';
2
- import { init_esm_shims } from './chunk-UVSNNADM.js';
1
+ export { pluginZod, pluginZodName } from './chunk-Y7E62IFJ.js';
2
+ import { init_esm_shims } from './chunk-UPICPEOA.js';
3
3
 
4
4
  // src/index.ts
5
5
  init_esm_shims();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-zod",
3
- "version": "3.0.0-alpha.16",
3
+ "version": "3.0.0-alpha.18",
4
4
  "description": "Generator plugin-zod",
5
5
  "keywords": [
6
6
  "typescript",
@@ -58,25 +58,20 @@
58
58
  "!/**/__tests__/**"
59
59
  ],
60
60
  "dependencies": {
61
- "@kubb/core": "3.0.0-alpha.16",
62
- "@kubb/fs": "3.0.0-alpha.16",
63
- "@kubb/oas": "3.0.0-alpha.16",
64
- "@kubb/parser-ts": "3.0.0-alpha.16",
65
- "@kubb/plugin-oas": "3.0.0-alpha.16",
66
- "@kubb/react": "3.0.0-alpha.16",
67
- "@kubb/types": "3.0.0-alpha.16"
61
+ "@kubb/core": "3.0.0-alpha.18",
62
+ "@kubb/fs": "3.0.0-alpha.18",
63
+ "@kubb/oas": "3.0.0-alpha.18",
64
+ "@kubb/parser-ts": "3.0.0-alpha.18",
65
+ "@kubb/plugin-oas": "3.0.0-alpha.18",
66
+ "@kubb/react": "3.0.0-alpha.18"
68
67
  },
69
68
  "devDependencies": {
70
- "@types/react": "^18.3.5",
71
- "prettier": "^3.3.3",
72
- "react": "^18.3.1",
73
69
  "tsup": "^8.2.4",
74
- "@kubb/config-biome": "3.0.0-alpha.16",
75
- "@kubb/config-ts": "3.0.0-alpha.16",
76
- "@kubb/config-tsup": "3.0.0-alpha.16"
70
+ "@kubb/config-ts": "3.0.0-alpha.18",
71
+ "@kubb/config-tsup": "3.0.0-alpha.18"
77
72
  },
78
73
  "peerDependencies": {
79
- "@kubb/react": "3.0.0-alpha.16"
74
+ "@kubb/react": "3.0.0-alpha.18"
80
75
  },
81
76
  "engines": {
82
77
  "node": ">=20"
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const test = z.union([z.object({ propertyA: z.string() }).strict(), z.object({ propertyA: z.string(), propertyB: z.string() }).strict()])
3
+ export const test = z.union([z.object({ "propertyA": z.string() }).strict(), z.object({ "propertyA": z.string(), "propertyB": z.string() }).strict()]);
@@ -1,15 +1,15 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description Null response
5
5
  */
6
- export const createPets201 = z.any()
6
+ export const createPets201 = z.any();
7
7
 
8
- /**
8
+ /**
9
9
  * @description unexpected error
10
10
  */
11
- export const createPetsError = z.lazy(() => error)
11
+ export const createPetsError = z.lazy(() => error);
12
12
 
13
- export const createPetsMutationRequest = z.object({ name: z.string(), tag: z.string() })
13
+ export const createPetsMutationRequest = z.object({ "name": z.string(), "tag": z.string() });
14
14
 
15
- export const createPetsMutationResponse = z.any()
15
+ export const createPetsMutationResponse = z.any();
@@ -1,15 +1,15 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description Null response
5
5
  */
6
- export const createPets201 = z.unknown()
6
+ export const createPets201 = z.unknown();
7
7
 
8
- /**
8
+ /**
9
9
  * @description unexpected error
10
10
  */
11
- export const createPetsError = z.lazy(() => error)
11
+ export const createPetsError = z.lazy(() => error);
12
12
 
13
- export const createPetsMutationRequest = z.object({ name: z.string(), tag: z.string() })
13
+ export const createPetsMutationRequest = z.object({ "name": z.string(), "tag": z.string() });
14
14
 
15
- export const createPetsMutationResponse = z.unknown()
15
+ export const createPetsMutationResponse = z.unknown();
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const deletePetsPetidMutationResponse = z.any()
3
+ export const deletePetsPetidMutationResponse = z.any();
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const enumNamesType = z.enum(['0', '1'])
3
+ export const enumNamesType = z.enum(["0", "1"]);
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const enumNullable = z.enum(['Pending', 'Received']).nullable()
3
+ export const enumNullable = z.enum(["Pending", "Received"]).nullable();
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const enumVarNamesType = z.union([z.literal(0), z.literal(1)])
3
+ export const enumVarNamesType = z.union([z.literal(0), z.literal(1)]);
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const example = z.object({ nestedExamples: z.lazy(() => example).optional() })
3
+ export const example = z.object({ "nestedExamples": z.lazy(() => example).optional() });
@@ -1,18 +1,18 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const listPetsQueryParams = z.object({ limit: z.string().describe('How many items to return at one time (max 100)').optional() }).optional()
3
+ export const listPetsQueryParams = z.object({ "limit": z.string().describe("How many items to return at one time (max 100)").optional() }).optional();
4
4
 
5
- /**
5
+ /**
6
6
  * @description A paged array of pets
7
7
  */
8
- export const listPets200 = z.lazy(() => pets)
8
+ export const listPets200 = z.lazy(() => pets);
9
9
 
10
- /**
10
+ /**
11
11
  * @description unexpected error
12
12
  */
13
- export const listPetsError = z.lazy(() => error)
13
+ export const listPetsError = z.lazy(() => error);
14
14
 
15
- /**
15
+ /**
16
16
  * @description A paged array of pets
17
17
  */
18
- export const listPetsQueryResponse = z.lazy(() => pets)
18
+ export const listPetsQueryResponse = z.lazy(() => pets);
@@ -1,6 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description This probably should fail miserably
5
5
  */
6
- export const mixedValueTypeConst = z.object({ foobar: z.literal('foobar') }).describe('This probably should fail miserably')
6
+ export const mixedValueTypeConst = z.object({ "foobar": z.literal("foobar") }).describe("This probably should fail miserably");
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const nullableString = z.string().nullable()
3
+ export const nullableString = z.string().nullable();
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const nullableStringUuid = z.string().uuid().nullable()
3
+ export const nullableStringUuid = z.string().uuid().nullable();
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const nullableStringWithAnyOf = z.union([z.string(), z.null()])
3
+ export const nullableStringWithAnyOf = z.union([z.string(), z.null()]);
@@ -1,6 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description its value is equal to the value of the keyword
5
5
  */
6
- export const numberValueConst = z.object({ foobar: z.literal(42) }).describe('its value is equal to the value of the keyword')
6
+ export const numberValueConst = z.object({ "foobar": z.literal(42) }).describe("its value is equal to the value of the keyword");
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const test = z.union([z.object({ propertyA: z.string().optional() }), z.object({ propertyA: z.string().optional() })])
3
+ export const test = z.union([z.object({ "propertyA": z.string().optional() }), z.object({ "propertyA": z.string().optional() })]);
@@ -1,60 +1,46 @@
1
- import {
2
- listPetsQueryResponse,
3
- listPetsQueryParams,
4
- createPetsMutationRequest,
5
- createPetsMutationResponse,
6
- showPetByIdQueryResponse,
7
- showPetByIdPathParams,
8
- } from './showPetById.ts'
1
+ import { listPetsQueryResponse, listPetsQueryParams, createPetsMutationRequest, createPetsMutationResponse, showPetByIdQueryResponse, showPetByIdPathParams } from "./showPetById.ts";
9
2
 
10
- export const operations = {
11
- listPets: {
12
- request: undefined,
13
- parameters: {
14
- path: undefined,
15
- query: listPetsQueryParams,
16
- header: undefined,
17
- },
18
- responses: {
19
- 200: listPetsQueryResponse,
20
- default: listPetsQueryResponse,
21
- },
22
- errors: {},
23
- },
24
- createPets: {
25
- request: createPetsMutationRequest,
26
- parameters: {
27
- path: undefined,
28
- query: undefined,
29
- header: undefined,
30
- },
31
- responses: {
32
- 201: createPetsMutationResponse,
33
- default: createPetsMutationResponse,
34
- },
35
- errors: {},
36
- },
37
- showPetById: {
38
- request: undefined,
39
- parameters: {
40
- path: showPetByIdPathParams,
41
- query: undefined,
42
- header: undefined,
43
- },
44
- responses: {
45
- 200: showPetByIdQueryResponse,
46
- default: showPetByIdQueryResponse,
47
- },
48
- errors: {},
49
- },
50
- } as const
3
+ export const operations = { "listPets": {
4
+ request: undefined,
5
+ parameters: {
6
+ path: undefined,
7
+ query: listPetsQueryParams,
8
+ header: undefined
9
+ },
10
+ responses: {
11
+ 200: listPetsQueryResponse,
12
+ default: listPetsQueryResponse
13
+ },
14
+ errors: {}
15
+ }, "createPets": {
16
+ request: createPetsMutationRequest,
17
+ parameters: {
18
+ path: undefined,
19
+ query: undefined,
20
+ header: undefined
21
+ },
22
+ responses: {
23
+ 201: createPetsMutationResponse,
24
+ default: createPetsMutationResponse
25
+ },
26
+ errors: {}
27
+ }, "showPetById": {
28
+ request: undefined,
29
+ parameters: {
30
+ path: showPetByIdPathParams,
31
+ query: undefined,
32
+ header: undefined
33
+ },
34
+ responses: {
35
+ 200: showPetByIdQueryResponse,
36
+ default: showPetByIdQueryResponse
37
+ },
38
+ errors: {}
39
+ } } as const;
51
40
 
52
- export const paths = {
53
- '/pets': {
54
- get: operations['listPets'],
55
- post: operations['createPets'],
56
- },
57
- '/pets/{petId}': {
58
- get: operations['showPetById'],
59
- },
60
- } as const
41
+ export const paths = { "/pets": {
42
+ get: operations["listPets"],
43
+ post: operations["createPets"]
44
+ }, "/pets/{petId}": {
45
+ get: operations["showPetById"]
46
+ } } as const;
@@ -1,5 +1,5 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const optionalPet = z.object({ id: z.number().int().optional(), name: z.string().optional(), tag: z.string().optional() })
3
+ export const optionalPet = z.object({ "id": z.number().int().optional(), "name": z.string().optional(), "tag": z.string().optional() });
4
4
 
5
- export type OptionalPet = z.infer<typeof optionalPet>
5
+ export type OptionalPet = z.infer<typeof optionalPet>;
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const optionalPet = z.object({ id: z.number().int().optional(), name: z.string().optional(), tag: z.string().optional() }) as z.ZodType<OptionalPet>
3
+ export const optionalPet = z.object({ "id": z.number().int().optional(), "name": z.string().optional(), "tag": z.string().optional() }) as z.ZodType<OptionalPet>;
@@ -1,10 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const order = z.object({
4
- id: z.number().int().optional(),
5
- petId: z.number().int().optional(),
6
- quantity: z.number().int().optional(),
7
- shipDate: z.date().optional(),
8
- status: z.enum(['placed', 'approved', 'delivered']).describe('Order Status').optional(),
9
- complete: z.boolean().optional(),
10
- })
3
+ export const order = z.object({ "id": z.number().int().optional(), "petId": z.number().int().optional(), "quantity": z.number().int().optional(), "shipDate": z.date().optional(), "status": z.enum(["placed", "approved", "delivered"]).describe("Order Status").optional(), "complete": z.boolean().optional() });
@@ -1,10 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const order = z.object({
4
- id: z.number().int().optional(),
5
- petId: z.number().int().optional(),
6
- quantity: z.number().int().optional(),
7
- shipDate: z.string().optional(),
8
- status: z.enum(['placed', 'approved', 'delivered']).describe('Order Status').optional(),
9
- complete: z.boolean().optional(),
10
- })
3
+ export const order = z.object({ "id": z.number().int().optional(), "petId": z.number().int().optional(), "quantity": z.number().int().optional(), "shipDate": z.string().optional(), "status": z.enum(["placed", "approved", "delivered"]).describe("Order Status").optional(), "complete": z.boolean().optional() });
@@ -1,10 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const order = z.object({
4
- id: z.number().int().optional(),
5
- petId: z.number().int().optional(),
6
- quantity: z.number().int().optional(),
7
- shipDate: z.string().datetime().optional(),
8
- status: z.enum(['placed', 'approved', 'delivered']).describe('Order Status').optional(),
9
- complete: z.boolean().optional(),
10
- })
3
+ export const order = z.object({ "id": z.number().int().optional(), "petId": z.number().int().optional(), "quantity": z.number().int().optional(), "shipDate": z.string().datetime().optional(), "status": z.enum(["placed", "approved", "delivered"]).describe("Order Status").optional(), "complete": z.boolean().optional() });
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const pet = z.object({ id: z.number().int(), name: z.string(), date: z.date().optional(), tag: z.string().min(5).max(100).optional() })
3
+ export const pet = z.object({ "id": z.number().int(), "name": z.string(), "date": z.date().optional(), "tag": z.string().min(5).max(100).optional() });
@@ -1,10 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description List of Pet object
5
5
  */
6
- export const petArray = z
7
- .array(z.lazy(() => pet))
8
- .min(1)
9
- .max(3)
10
- .describe('List of Pet object')
6
+ export const petArray = z.array(z.lazy(() => pet)).min(1).max(3).describe("List of Pet object");
@@ -1,8 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const pet = z.object({
4
- id: z.coerce.number().int(),
5
- name: z.coerce.string(),
6
- date: z.coerce.date().optional(),
7
- tag: z.coerce.string().min(5).max(100).optional(),
8
- })
3
+ export const pet = z.object({ "id": z.coerce.number().int(), "name": z.coerce.string(), "date": z.coerce.date().optional(), "tag": z.coerce.string().min(5).max(100).optional() });
@@ -1,6 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description Tuple of exact length 2 nested in an object
5
5
  */
6
- export const petTupleObject = z.object({ tupleProperty: z.tuple([z.string(), z.string()]).optional() }).describe('Tuple of exact length 2 nested in an object')
6
+ export const petTupleObject = z.object({ "tupleProperty": z.tuple([z.string(), z.string()]).optional() }).describe("Tuple of exact length 2 nested in an object");
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const pet = z.object({ id: z.number().int(), name: z.string().email(), date: z.date().optional(), tag: z.string().min(5).max(100).optional() })
3
+ export const pet = z.object({ "id": z.number().int(), "name": z.string().email(), "date": z.date().optional(), "tag": z.string().min(5).max(100).optional() });
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const pets = z.array(z.object({ id: z.number().int(), name: z.string(), tag: z.string().optional() })) as z.ZodType<Pets>
3
+ export const pets = z.array(z.object({ "id": z.number().int(), "name": z.string(), "tag": z.string().optional() })) as z.ZodType<Pets>;
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const example = z.object({ name: z.string(), children: z.array(z.lazy(() => example)) })
3
+ export const example = z.object({ "name": z.string(), "children": z.array(z.lazy(() => example)) });
@@ -1,21 +1,18 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const showPetByIdPathParams = z.object({
4
- petId: z.string().describe('The id of the pet to retrieve'),
5
- testId: z.string().describe('The id of the pet to retrieve'),
6
- })
3
+ export const showPetByIdPathParams = z.object({ "petId": z.string().describe("The id of the pet to retrieve"), "testId": z.string().describe("The id of the pet to retrieve") });
7
4
 
8
- /**
5
+ /**
9
6
  * @description Expected response to a valid request
10
7
  */
11
- export const showPetById200 = z.lazy(() => pet)
8
+ export const showPetById200 = z.lazy(() => pet);
12
9
 
13
- /**
10
+ /**
14
11
  * @description unexpected error
15
12
  */
16
- export const showPetByIdError = z.lazy(() => error)
13
+ export const showPetByIdError = z.lazy(() => error);
17
14
 
18
- /**
15
+ /**
19
16
  * @description Expected response to a valid request
20
17
  */
21
- export const showPetByIdQueryResponse = z.lazy(() => pet)
18
+ export const showPetByIdQueryResponse = z.lazy(() => pet);
@@ -1,6 +1,6 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- /**
3
+ /**
4
4
  * @description its value is equal to the value of the keyword
5
5
  */
6
- export const stringValueConst = z.object({ foobar: z.literal('foobar') }).describe('its value is equal to the value of the keyword')
6
+ export const stringValueConst = z.object({ "foobar": z.literal("foobar") }).describe("its value is equal to the value of the keyword");
@@ -1,3 +1,3 @@
1
- import { z } from 'zod'
1
+ import { z } from "zod";
2
2
 
3
- export const uuidSchema = z.string().uuid()
3
+ export const uuidSchema = z.string().uuid();
@@ -3,7 +3,7 @@ import { type SchemaKeywordMapper, isKeyword, schemaKeywords } from '@kubb/plugi
3
3
 
4
4
  import type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'
5
5
 
6
- export const zodKeywordMapper = {
6
+ const zodKeywordMapper = {
7
7
  any: () => 'z.any()',
8
8
  unknown: () => 'z.unknown()',
9
9
  number: (coercion?: boolean, min?: number, max?: number) => {
package/src/types.ts CHANGED
@@ -128,9 +128,4 @@ type ResolvedOptions = {
128
128
  operations: NonNullable<Options['coercion']>
129
129
  }
130
130
 
131
- export type FileMeta = {
132
- pluginKey?: Plugin['key']
133
- tag?: string
134
- }
135
-
136
131
  export type PluginZod = PluginFactoryOptions<'plugin-zod', Options, ResolvedOptions, never, ResolvePathOptions>