fastify-zod-openapi
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -98,2 +98,3 @@ import { FastifyTypeProvider, FastifyPluginAsync, FastifyPluginOptions, RawServerBase, RawServerDefault, FastifyPluginCallback, FastifySchema, FastifySchemaCompiler } from 'fastify'; | ||
stringify?: (value: unknown) => string; | ||
fallbackSerializer?: FastifySerializerCompiler<ZodType>; | ||
} | ||
@@ -100,0 +101,0 @@ declare const createSerializerCompiler: (opts?: SerializerOptions) => FastifySerializerCompiler<ZodType>; |
{ | ||
"name": "fastify-zod-openapi", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Fastify plugin for zod-openapi", | ||
@@ -62,10 +62,11 @@ "keywords": [ | ||
"@crackle/cli": "0.15.5", | ||
"@fastify/swagger": "9.4.0", | ||
"@fastify/swagger-ui": "5.2.0", | ||
"@types/node": "22.10.2", | ||
"@fastify/swagger": "9.4.2", | ||
"@fastify/swagger-ui": "5.2.1", | ||
"@fastify/under-pressure": "9.0.3", | ||
"@types/node": "22.10.7", | ||
"eslint-plugin-zod-openapi": "1.0.0", | ||
"fastify": "5.2.0", | ||
"fastify": "5.2.1", | ||
"skuba": "9.1.0", | ||
"zod": "3.24.1", | ||
"zod-openapi": "4.2.0" | ||
"zod-openapi": "4.2.2" | ||
}, | ||
@@ -72,0 +73,0 @@ "peerDependencies": { |
@@ -226,2 +226,12 @@ <p align="center"> | ||
By default, this library assumes that if a response schema provided is not a Zod Schema, it is a JSON Schema and will naively pass it straight into `fast-json-stringify`. This will not work in conjunction with Fastify's schema registration. | ||
If you have other routes with response schemas which are not Zod Schemas, you can supply a `fallbackSerializer` to `createSerializerCompiler`. | ||
```ts | ||
const customSerializerCompiler = createSerializerCompiler({ | ||
fallbackSerializer: ({ schema, url, method }) => customSerializer(schema), | ||
}); | ||
``` | ||
Please note: the `responses`, `parameters` components do not appear to be supported by the `@fastify/swagger` library. | ||
@@ -228,0 +238,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47791
792
428
10