🚨 Breaking Changes 🚨
- The
onError,onSuccess, and similar hooks have been completely removed from all APIs. Please use the newinterceptorsinstead. - The
ZodCoercerhas been removed. Use the newZodAutoCoercePlugininstead.
🌟 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
ZodAutoCoercePlugininRPCHandleras it is unnecessary and impacts performance.
🚨 Breaking Changes
- server: