---
changelog:
  category: Release
  version: 1.8.6
date: '2025-09-01T12:07:22Z'
seo:
  description: >-
    The Response Validation Plugin validates server responses against your
    contract schema, ensuring that data returned from your server matches the
    expected…
title: v1.8.6
type: changelog
---
### Response Validation Plugin [docs](https://orpc.dinwwwh.com/docs/plugins/response-validation)

The Response Validation Plugin validates server responses against your contract schema, ensuring that data returned from your server matches the expected types defined in your contract.

```ts
import { RPCLink } from '@orpc/client/fetch'
import { ResponseValidationPlugin } from '@orpc/contract/plugins'

const link = new RPCLink({
  url: 'http://localhost:3000/rpc',
  plugins: [
    new ResponseValidationPlugin(contract),
  ],
})

const client: ContractRouterClient<typeof contract> = createORPCClient(link)
```

> [!TIP]
> Beyond response validation, this plugin also serves special purposes such as [Expanding Type Support for OpenAPI Link](https://orpc.dinwwwh.com/docs/openapi/advanced/expanding-type-support-for-openapi-link).

###  Support fetch headers in link header option

```diff
 import { RPCLink } from '@orpc/client/fetch'
 const link = new RPCLink({
   url: `${typeof window !== 'undefined' ? window.location.origin : 'http://localhost:3000'}/rpc`,
   headers: async () => {
     if (typeof window !== 'undefined') {
       return {}
     }

    const { headers } = await import('next/headers')
-    return Object.fromEntries(await headers())
+    return await headers()
   },
 })
```

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

- **client**:
  - Support fetch headers in link options &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/946 [<samp>(216e5)</samp>](https://github.com/middleapi/orpc/commit/216e5a5b)
- **contract**:
  - Add failed data to ValidationError for debugging &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/949 [<samp>(f437d)</samp>](https://github.com/middleapi/orpc/commit/f437dcba)
  - Response Validation Plugin &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/953 [<samp>(5a170)</samp>](https://github.com/middleapi/orpc/commit/5a170fe1)
- **openapi**:
  - Form-data helpers &nbsp;-&nbsp; by @dinwwwh in https://github.com/middleapi/orpc/issues/951 [<samp>(4b3a4)</samp>](https://github.com/middleapi/orpc/commit/4b3a4c56)

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