@bram-dc/fastify-type-provider-zod 3.0.0
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/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +160 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 turkerdev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Fastify Type Provider Zod
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/fastify-type-provider-zod)
|
|
4
|
+
[](https://npmjs.org/package/fastify-type-provider-zod)
|
|
5
|
+
[](https://github.com/bram-dc/fastify-type-provider-zod/actions)
|
|
6
|
+
|
|
7
|
+
## How to use?
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import Fastify from "fastify";
|
|
11
|
+
import { ZodSerializerCompiler, ZodValidatorCompiler, ZodTypeProvider } from "fastify-type-provider-zod";
|
|
12
|
+
import z from "zod";
|
|
13
|
+
|
|
14
|
+
const app = Fastify()
|
|
15
|
+
|
|
16
|
+
// Add schema validator and serializer
|
|
17
|
+
app.setValidatorCompiler(ZodValidatorCompiler);
|
|
18
|
+
app.setSerializerCompiler(ZodSerializerCompiler);
|
|
19
|
+
|
|
20
|
+
app.withTypeProvider<ZodTypeProvider>().route({
|
|
21
|
+
method: "GET",
|
|
22
|
+
url: "/",
|
|
23
|
+
// Define your schema
|
|
24
|
+
schema: {
|
|
25
|
+
querystring: z.object({
|
|
26
|
+
name: z.string().min(4),
|
|
27
|
+
}),
|
|
28
|
+
response: {
|
|
29
|
+
200: z.string(),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
handler: (req, res) => {
|
|
33
|
+
res.send(req.query.name);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
app.listen({ port: 4949 });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## How to use together with @fastify/swagger
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import fastify from "fastify";
|
|
44
|
+
import fastifySwagger from "@fastify/swagger";
|
|
45
|
+
import fastifySwaggerUI from "@fastify/swagger-ui";
|
|
46
|
+
import { z } from "zod";
|
|
47
|
+
|
|
48
|
+
import {
|
|
49
|
+
jsonSchemaTransform,
|
|
50
|
+
createJsonSchemaTransform,
|
|
51
|
+
ZodSerializerCompiler,
|
|
52
|
+
ZodValidatorCompiler,
|
|
53
|
+
ZodTypeProvider,
|
|
54
|
+
} from "fastify-type-provider-zod";
|
|
55
|
+
|
|
56
|
+
const app = fastify();
|
|
57
|
+
app.setValidatorCompiler(ZodValidatorCompiler);
|
|
58
|
+
app.setSerializerCompiler(ZodSerializerCompiler);
|
|
59
|
+
|
|
60
|
+
app.register(fastifySwagger, {
|
|
61
|
+
openapi: {
|
|
62
|
+
info: {
|
|
63
|
+
title: "SampleApi",
|
|
64
|
+
description: "Sample backend service",
|
|
65
|
+
version: "1.0.0",
|
|
66
|
+
},
|
|
67
|
+
servers: [],
|
|
68
|
+
},
|
|
69
|
+
transform: jsonSchemaTransform,
|
|
70
|
+
// You can also create transform with custom skiplist of endpoints that should not be included in the specification:
|
|
71
|
+
//
|
|
72
|
+
// transform: createJsonSchemaTransform({
|
|
73
|
+
// skipList: [ "/documentation/static/*" ]
|
|
74
|
+
// })
|
|
75
|
+
|
|
76
|
+
// In order to create refs to the schemas, you need to provide the schemas to the transformObject using createJsonSchemaTransformObject
|
|
77
|
+
//
|
|
78
|
+
// transformObject: createJsonSchemaTransformObject({
|
|
79
|
+
// schemas: {
|
|
80
|
+
// User: z.object({
|
|
81
|
+
// id: z.string(),
|
|
82
|
+
// name: z.string(),
|
|
83
|
+
// }),
|
|
84
|
+
// }
|
|
85
|
+
// }),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
app.register(fastifySwaggerUI, {
|
|
89
|
+
routePrefix: "/documentation",
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const LOGIN_SCHEMA = z.object({
|
|
93
|
+
username: z.string().max(32).describe("Some description for username"),
|
|
94
|
+
password: z.string().max(32),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
app.after(() => {
|
|
98
|
+
app.withTypeProvider<ZodTypeProvider>().route({
|
|
99
|
+
method: "POST",
|
|
100
|
+
url: "/login",
|
|
101
|
+
schema: { body: LOGIN_SCHEMA },
|
|
102
|
+
handler: (req, res) => {
|
|
103
|
+
res.send("ok");
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
async function run() {
|
|
109
|
+
await app.ready();
|
|
110
|
+
|
|
111
|
+
await app.listen({
|
|
112
|
+
port: 4949,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
console.log(`Documentation running at http://localhost:4949/documentation`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
run();
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## How to create a plugin?
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import { z } from "zod";
|
|
125
|
+
import { FastifyPluginAsyncZod } from "fastify-type-provider-zod";
|
|
126
|
+
|
|
127
|
+
const plugin: FastifyPluginAsyncZod = async function (fastify, _opts) {
|
|
128
|
+
fastify.route({
|
|
129
|
+
method: "GET",
|
|
130
|
+
url: "/",
|
|
131
|
+
// Define your schema
|
|
132
|
+
schema: {
|
|
133
|
+
querystring: z.object({
|
|
134
|
+
name: z.string().min(4),
|
|
135
|
+
}),
|
|
136
|
+
response: {
|
|
137
|
+
200: z.string(),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
handler: (req, res) => {
|
|
141
|
+
res.send(req.query.name);
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { FastifyPluginAsync, FastifyPluginCallback, FastifyPluginOptions, FastifySchema, FastifySchemaCompiler, FastifyTypeProvider, RawServerBase, RawServerDefault } from "fastify";
|
|
2
|
+
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
|
|
3
|
+
import type { FastifySerializerCompiler } from "fastify/types/schema";
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
type FreeformRecord = Record<string, any>;
|
|
6
|
+
export declare const ResponseValidationError: import("@fastify/error").FastifyErrorConstructor<{
|
|
7
|
+
code: string;
|
|
8
|
+
}, [{
|
|
9
|
+
cause: Error;
|
|
10
|
+
}]>;
|
|
11
|
+
export declare const InvalidSchemaError: import("@fastify/error").FastifyErrorConstructor<{
|
|
12
|
+
code: string;
|
|
13
|
+
}, [string]>;
|
|
14
|
+
export interface ZodTypeProvider extends FastifyTypeProvider {
|
|
15
|
+
validator: this["schema"] extends z.ZodTypeAny ? z.output<this["schema"]> : unknown;
|
|
16
|
+
serializer: this["schema"] extends z.ZodTypeAny ? z.input<this["schema"]> : unknown;
|
|
17
|
+
}
|
|
18
|
+
interface Schema extends FastifySchema {
|
|
19
|
+
hide?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const createJsonSchemaTransform: ({ skipList }: {
|
|
22
|
+
skipList: readonly string[];
|
|
23
|
+
}) => ({ schema, url }: {
|
|
24
|
+
schema: Schema;
|
|
25
|
+
url: string;
|
|
26
|
+
}) => {
|
|
27
|
+
schema: Schema;
|
|
28
|
+
url: string;
|
|
29
|
+
} | {
|
|
30
|
+
schema: FreeformRecord;
|
|
31
|
+
url: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const jsonSchemaTransform: ({ schema, url }: {
|
|
34
|
+
schema: Schema;
|
|
35
|
+
url: string;
|
|
36
|
+
}) => {
|
|
37
|
+
schema: Schema;
|
|
38
|
+
url: string;
|
|
39
|
+
} | {
|
|
40
|
+
schema: FreeformRecord;
|
|
41
|
+
url: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const ZodValidatorCompiler: FastifySchemaCompiler<z.ZodAny>;
|
|
44
|
+
export declare const ZodSerializerCompiler: FastifySerializerCompiler<z.ZodAny | {
|
|
45
|
+
properties: z.ZodAny;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const createJsonSchemaTransformObject: ({ schemas: zodSchemas }: {
|
|
48
|
+
schemas: Record<string, z.ZodTypeAny>;
|
|
49
|
+
}) => (input: {
|
|
50
|
+
swaggerObject: Partial<OpenAPIV2.Document>;
|
|
51
|
+
} | {
|
|
52
|
+
openapiObject: Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
|
|
53
|
+
}) => any;
|
|
54
|
+
/**
|
|
55
|
+
* FastifyPluginCallbackZod with Zod automatic type inference
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* import { FastifyPluginCallbackZod } from "fastify-type-provider-zod"
|
|
60
|
+
*
|
|
61
|
+
* const plugin: FastifyPluginCallbackZod = (fastify, options, done) => {
|
|
62
|
+
* done()
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export type FastifyPluginCallbackZod<Options extends FastifyPluginOptions = Record<never, never>, Server extends RawServerBase = RawServerDefault> = FastifyPluginCallback<Options, Server, ZodTypeProvider>;
|
|
67
|
+
/**
|
|
68
|
+
* FastifyPluginAsyncZod with Zod automatic type inference
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* import { FastifyPluginAsyncZod } from "fastify-type-provider-zod"
|
|
73
|
+
*
|
|
74
|
+
* const plugin: FastifyPluginAsyncZod = async (fastify, options) => {
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export type FastifyPluginAsyncZod<Options extends FastifyPluginOptions = Record<never, never>, Server extends RawServerBase = RawServerDefault> = FastifyPluginAsync<Options, Server, ZodTypeProvider>;
|
|
79
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createJsonSchemaTransformObject = exports.ZodSerializerCompiler = exports.ZodValidatorCompiler = exports.jsonSchemaTransform = exports.createJsonSchemaTransform = exports.InvalidSchemaError = exports.ResponseValidationError = void 0;
|
|
7
|
+
const error_1 = __importDefault(require("@fastify/error"));
|
|
8
|
+
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
9
|
+
const defaultSkipList = [
|
|
10
|
+
"/documentation/",
|
|
11
|
+
"/documentation/initOAuth",
|
|
12
|
+
"/documentation/json",
|
|
13
|
+
"/documentation/uiConfig",
|
|
14
|
+
"/documentation/yaml",
|
|
15
|
+
"/documentation/*",
|
|
16
|
+
"/documentation/static/*",
|
|
17
|
+
];
|
|
18
|
+
exports.ResponseValidationError = (0, error_1.default)("FST_ERR_RESPONSE_VALIDATION", "Response doesn't match the schema", 500);
|
|
19
|
+
exports.InvalidSchemaError = (0, error_1.default)("FST_ERR_INVALID_SCHEMA", "Invalid schema passed: %s", 500);
|
|
20
|
+
const zodToJsonSchemaOptions = {
|
|
21
|
+
target: "openApi3",
|
|
22
|
+
$refStrategy: "none",
|
|
23
|
+
};
|
|
24
|
+
const createJsonSchemaTransform = ({ skipList }) => {
|
|
25
|
+
return ({ schema, url }) => {
|
|
26
|
+
if (!schema) {
|
|
27
|
+
return {
|
|
28
|
+
schema,
|
|
29
|
+
url,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const { response, headers, querystring, body, params, hide, ...rest } = schema;
|
|
33
|
+
const transformed = {};
|
|
34
|
+
if (skipList.includes(url) || hide) {
|
|
35
|
+
transformed.hide = true;
|
|
36
|
+
return { schema: transformed, url };
|
|
37
|
+
}
|
|
38
|
+
const zodSchemas = { headers, querystring, body, params };
|
|
39
|
+
for (const prop in zodSchemas) {
|
|
40
|
+
const zodSchema = zodSchemas[prop];
|
|
41
|
+
if (zodSchema) {
|
|
42
|
+
transformed[prop] = (0, zod_to_json_schema_1.zodToJsonSchema)(zodSchema, zodToJsonSchemaOptions);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (response) {
|
|
46
|
+
transformed.response = {};
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
for (const prop in response) {
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
const schema = resolveSchema(response[prop]);
|
|
51
|
+
const transformedResponse = (0, zod_to_json_schema_1.zodToJsonSchema)(
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
schema, zodToJsonSchemaOptions);
|
|
54
|
+
transformed.response[prop] = transformedResponse;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
for (const prop in rest) {
|
|
58
|
+
const meta = rest[prop];
|
|
59
|
+
if (meta) {
|
|
60
|
+
transformed[prop] = meta;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { schema: transformed, url };
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.createJsonSchemaTransform = createJsonSchemaTransform;
|
|
67
|
+
exports.jsonSchemaTransform = (0, exports.createJsonSchemaTransform)({
|
|
68
|
+
skipList: defaultSkipList,
|
|
69
|
+
});
|
|
70
|
+
const ZodValidatorCompiler = ({ schema }) => (data) => {
|
|
71
|
+
const result = schema.safeParse(data);
|
|
72
|
+
if (result.success) {
|
|
73
|
+
return { value: result.data };
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return {
|
|
77
|
+
error: result.error.errors.map(error => ({
|
|
78
|
+
keyword: error.code,
|
|
79
|
+
instancePath: `/${error.path.join("/")}`,
|
|
80
|
+
schemaPath: `#/${error.path.join("/")}/${error.code}`,
|
|
81
|
+
params: {
|
|
82
|
+
code: error.code,
|
|
83
|
+
zodError: result.error,
|
|
84
|
+
},
|
|
85
|
+
message: error.message,
|
|
86
|
+
})),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.ZodValidatorCompiler = ZodValidatorCompiler;
|
|
91
|
+
const resolveSchema = (maybeSchema) => {
|
|
92
|
+
if ("safeParse" in maybeSchema) {
|
|
93
|
+
return maybeSchema;
|
|
94
|
+
}
|
|
95
|
+
if ("properties" in maybeSchema) {
|
|
96
|
+
return maybeSchema.properties;
|
|
97
|
+
}
|
|
98
|
+
throw new exports.InvalidSchemaError(JSON.stringify(maybeSchema));
|
|
99
|
+
};
|
|
100
|
+
const ZodSerializerCompiler = ({ schema: maybeSchema }) => (data) => {
|
|
101
|
+
const schema = resolveSchema(maybeSchema);
|
|
102
|
+
const result = schema.safeParse(data);
|
|
103
|
+
if (result.success) {
|
|
104
|
+
return JSON.stringify(result.data);
|
|
105
|
+
}
|
|
106
|
+
throw new exports.ResponseValidationError({ cause: result.error });
|
|
107
|
+
};
|
|
108
|
+
exports.ZodSerializerCompiler = ZodSerializerCompiler;
|
|
109
|
+
const createJsonSchemaTransformObject = ({ schemas: zodSchemas }) => (input) => {
|
|
110
|
+
if ("swaggerObject" in input) {
|
|
111
|
+
console.warn("This package currently does not support component references for Swagger 2.0");
|
|
112
|
+
return input.swaggerObject;
|
|
113
|
+
}
|
|
114
|
+
const schemas = {};
|
|
115
|
+
for (const key in zodSchemas) {
|
|
116
|
+
schemas[key] = (0, zod_to_json_schema_1.zodToJsonSchema)(zodSchemas[key], zodToJsonSchemaOptions);
|
|
117
|
+
}
|
|
118
|
+
const document = {
|
|
119
|
+
...input.openapiObject,
|
|
120
|
+
components: {
|
|
121
|
+
...input.openapiObject.components,
|
|
122
|
+
schemas: {
|
|
123
|
+
...input.openapiObject.components?.schemas,
|
|
124
|
+
...schemas,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
const componentMapVK = new Map();
|
|
129
|
+
Object.entries(schemas).forEach(([key, value]) => componentMapVK.set(JSON.stringify(value), key));
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
+
function componentReplacer(key, value) {
|
|
132
|
+
if (typeof value !== "object") {
|
|
133
|
+
return value;
|
|
134
|
+
}
|
|
135
|
+
// Check if the parent is the schemas object, if so, return the value as is
|
|
136
|
+
if (this === document.components.schemas) {
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
const stringifiedValue = JSON.stringify(value);
|
|
140
|
+
if (componentMapVK.has(stringifiedValue)) {
|
|
141
|
+
return { $ref: `#/components/schemas/${componentMapVK.get(stringifiedValue)}` };
|
|
142
|
+
}
|
|
143
|
+
if (value.nullable === true) {
|
|
144
|
+
const nonNullableValue = { ...value };
|
|
145
|
+
delete nonNullableValue.nullable;
|
|
146
|
+
const stringifiedNonNullableValue = JSON.stringify(nonNullableValue);
|
|
147
|
+
if (componentMapVK.has(stringifiedNonNullableValue)) {
|
|
148
|
+
return {
|
|
149
|
+
anyOf: [
|
|
150
|
+
{ $ref: `#/components/schemas/${componentMapVK.get(stringifiedNonNullableValue)}` },
|
|
151
|
+
],
|
|
152
|
+
nullable: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
return JSON.parse(JSON.stringify(document, componentReplacer));
|
|
159
|
+
};
|
|
160
|
+
exports.createJsonSchemaTransformObject = createJsonSchemaTransformObject;
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bram-dc/fastify-type-provider-zod",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"description": "Zod Type Provider for Fastify@5",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"test": "npm run build && npm run typescript && vitest",
|
|
16
|
+
"lint": "eslint .",
|
|
17
|
+
"lint:fix": "eslint --fix .",
|
|
18
|
+
"typescript": "tsd",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"fastify": "^5.0.0",
|
|
23
|
+
"zod": "^3.23.8"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"url": "https://github.com/bram-dc/fastify-type-provider-zod"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"fastify",
|
|
30
|
+
"zod",
|
|
31
|
+
"type",
|
|
32
|
+
"provider"
|
|
33
|
+
],
|
|
34
|
+
"author": "turkerd",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/bram-dc/fastify-type-provider-zod/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/bram-dc/fastify-type-provider-zod",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@fastify/error": "^4.0.0",
|
|
42
|
+
"zod-to-json-schema": "^3.23.3"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@fastify/swagger": "^9.0.0",
|
|
46
|
+
"@fastify/swagger-ui": "^5.0.1",
|
|
47
|
+
"@stylistic/eslint-plugin": "^2.8.0",
|
|
48
|
+
"@types/node": "^22.5.5",
|
|
49
|
+
"eslint": "^9.10.0",
|
|
50
|
+
"fastify": "^5.0.0",
|
|
51
|
+
"fastify-plugin": "^5.0.0",
|
|
52
|
+
"oas-validator": "^5.0.8",
|
|
53
|
+
"openapi-types": "^12.1.3",
|
|
54
|
+
"tsd": "^0.31.2",
|
|
55
|
+
"typescript": "^5.6.2",
|
|
56
|
+
"typescript-eslint": "^8.6.0",
|
|
57
|
+
"vitest": "^2.1.1",
|
|
58
|
+
"zod": "^3.23.8"
|
|
59
|
+
},
|
|
60
|
+
"tsd": {
|
|
61
|
+
"directory": "types"
|
|
62
|
+
}
|
|
63
|
+
}
|