🚨 Breaking Changes 🚨
- The
onError
,onSuccess
, and similar hooks have been completely removed from all APIs. Please use the newinterceptors
instead. - The
ZodCoercer
has been removed. Use the newZodAutoCoercePlugin
instead.
🌟 ZodAutoCoercePlugin 🌟
The ZodAutoCoercePlugin
fully replaces ZodCoercer
for automatically coercing types based on your schema.
const openAPIHandler = new OpenAPIHandler(router, {
interceptors: [
onError((error) => {
console.error(error)
}),
],
plugins: [
new CORSPlugin({
origin: 'http://localhost:3000',
}),
new ResponseHeadersPlugin(),
new ZodAutoCoercePlugin(),
],
})
Note: Do not use
ZodAutoCoercePlugin
inRPCHandler
as it is unnecessary and impacts performance.
🚨 Breaking Changes
- server: