---
changelog:
  category: Release
  version: 1.10.2
date: '2025-10-26T09:47:54Z'
seo:
  description: >-
    By default, OpenAPIHandler, OpenAPIGenerator, and OpenAPILink share the same
    error response format. You can customize one, some, or all of them based on
    your…
title: v1.10.2
type: changelog
---
### OpenAPI - custom error format [docs](https://orpc.dinwwwh.com/docs/openapi/advanced/customizing-error-response)

By default, [OpenAPIHandler](https://orpc.dinwwwh.com/docs/openapi/openapi-handler), [OpenAPIGenerator](https://orpc.dinwwwh.com/docs/openapi/openapi-specification), and [OpenAPILink](https://orpc.dinwwwh.com/docs/openapi/client/openapi-link) share the same error response format. You can customize one, some, or all of them based on your requirements.

```ts
const handler = new OpenAPIHandler(router, {
  customErrorResponseBodyEncoder(error) {
    return error.toJSON()
  },
})
```

### Native Fastify adapter [docs](https://orpc.dinwwwh.com/docs/adapters/fastify)

Previously, oRPC in Fastify used the Node adapter, which didn't integrate well with Fastify's ecosystem (e.g., cookies, helpers, middleware). This native adapter supports Fastify's request/reply APIs directly, enabling full access to Fastify features within oRPC.

```ts
import Fastify from 'fastify'
import { RPCHandler } from '@orpc/server/fastify'
import { onError } from '@orpc/server'

const handler = new RPCHandler(router, {
  interceptors: [
    onError((error) => {
      console.error(error)
    })
  ]
})

const fastify = Fastify()

fastify.addContentTypeParser('*', (request, payload, done) => {
  // Fully utilize oRPC feature by allowing any content type
  // And let oRPC parse the body manually by passing `undefined`
  done(null, undefined)
})

fastify.all('/rpc/*', async (req, reply) => {
  const { matched } = await handler.handle(req, reply, {
    prefix: '/rpc',
    context: {} // Provide initial context if needed
  })

  if (!matched) {
    reply.status(404).send('Not found')
  }
})

fastify.listen({ port: 3000 }).then(() => console.log('Server running on http://localhost:3000'))
```

### &nbsp;&nbsp;&nbsp;🚀 Features

- **openapi**: Support custom error response format &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/1137 [<samp>(66a82)</samp>](https://github.com/middleapi/orpc/commit/66a829da)
- **server**: Native Fastify adapter &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/1127 [<samp>(fe89a)</samp>](https://github.com/middleapi/orpc/commit/fe89a39a)

> [!TIP]
> If you find oRPC valuable and would like to support its development, you can do so [here](https://github.com/sponsors/dinwwwh).

##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](https://github.com/middleapi/orpc/compare/v1.10.1...v1.10.2)
