{"_id":"@9or9/trpc-openapi","_rev":"1-3e945e63324c588f50093b61cbe79c93","name":"@9or9/trpc-openapi","dist-tags":{"latest":"2.0.1"},"versions":{"2.0.0":{"name":"@9or9/trpc-openapi","version":"2.0.0","author":{"name":"https://github.com/vercjames"},"license":"MIT","_id":"@9or9/trpc-openapi@2.0.0","maintainers":[{"name":"denvey","email":"350132612@qq.com"}],"homepage":"https://github.com/vercjames/package-trpc-swagger","bugs":{"url":"https://github.com/vercjames/package-trpc-swagger/issues"},"dist":{"shasum":"cf0321b3bc65208b571c5f8e40028b5bf9d5c3fc","tarball":"https://registry.npmjs.org/@9or9/trpc-openapi/-/trpc-openapi-2.0.0.tgz","fileCount":30,"integrity":"sha512-ik3fsAhlaWqb7uoO8my9MJYspsRDRijAAgS39LY9skbgu6Auhg08M6n/JyZVj8wwnLvQ/q9+TfRImiCuzouI5w==","signatures":[{"sig":"MEQCIDFQ6s/m9AIUitW9Ki6zxZ8jLejoOmt+Sa0qYK1dkF+MAiBdmI9109GMUmIPO28shWFLN7nJQ8KDfbbApg9sgYtCew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":532475},"main":"build/index.js","tsup":{"clean":true,"entry":["packages/index.ts"],"outDir":"build","sourcemap":true,"splitting":true},"types":"build/index.d.ts","gitHead":"099d2ffda8f0ee088f7f7519d395b916b2f15c6a","scripts":{"lint":"eslint \"./packages/**/*.{js,jsx,ts,tsx}\"","test":"node --experimental-modules --experimental-vm-modules node_modules/.bin/jest --config jest.config.ts","build":"tsup --format cjs,esm --dts","format":"eslint --fix \"./packages/**/*.{js,jsx,ts,tsx}\"","prepublishOnly":"rimraf build && yarn build"},"_npmUser":{"name":"denvey","email":"350132612@qq.com"},"repository":{"url":"git+https://github.com/vercjames/package-trpc-swagger.git","type":"git"},"workspaces":[".","examples/with-express","examples/with-fastify","examples/with-interop","examples/with-nextjs","examples/with-nextjs-app","examples/with-nuxtjs","examples/with-serverless"],"_npmVersion":"10.7.0","description":"tRPC Swagger Wrapper","directories":{},"_nodeVersion":"22.1.0","dependencies":{"co-body":"^6.1.0","chalk-scripts":"^1.2.8","openapi-types":"^12.1.3","node-mocks-http":"^1.14.1","lodash.clonedeep":"^4.5.0","zod-to-json-schema":"^3.23.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.11.0","zod":"^3.23.8","jest":"^29.7.0","mime":"^4.0.3","next":"^14.2.3","tsup":"^8.0.2","eslint":"^8.57.0","semver":"^7.6.2","express":"^4.19.2","fastify":"^4.27.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","superjson":"^1.13.3","aws-lambda":"^1.0.7","node-fetch":"^2.7.0","typescript":"^5.4.5","@types/jest":"^29.5.12","@types/mime":"^4.0.0","@types/node":"^20.12.13","@trpc/client":"^10.45.2","@trpc/server":"^10.45.2","@types/co-body":"^6.1.3","@types/express":"^4.17.21","@types/aws-lambda":"^8.10.138","@types/node-fetch":"^2.6.11","eslint-plugin-react":"^7.34.2","eslint-config-airbnb":"19.0.4","eslint-plugin-import":"^2.29.1","eslint-plugin-promise":"^6.2.0","eslint-plugin-jsx-a11y":"^6.8.0","@types/lodash.clonedeep":"^4.5.9","openapi-schema-validator":"^12.1.3","@typescript-eslint/parser":"^7.11.0","eslint-plugin-react-hooks":"^4.6.2","@typescript-eslint/eslint-plugin":"^7.11.0"},"peerDependencies":{"zod":"^3.14.4","@trpc/client":"^10.45.2","@trpc/server":"^10.45.2"},"_npmOperationalInternal":{"tmp":"tmp/trpc-openapi_2.0.0_1721964538571_0.9523482555689136","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@9or9/trpc-openapi","license":"MIT","version":"2.0.1","description":"tRPC openapi","author":{"name":"https://github.com/denvey"},"homepage":"https://github.com/9or9/trpc-openapi","bugs":{"url":"https://github.com/9or9/trpc-openapi/issues"},"main":"build/index.js","types":"build/index.d.ts","repository":{"type":"git","url":"git+https://github.com/9or9/trpc-openapi.git"},"scripts":{"build":"tsup --format cjs,esm --dts","prepublishOnly":"rimraf build && yarn build","format":"eslint --fix \"./packages/**/*.{js,jsx,ts,tsx}\"","lint":"eslint \"./packages/**/*.{js,jsx,ts,tsx}\"","test":"node --experimental-modules --experimental-vm-modules node_modules/.bin/jest --config jest.config.ts"},"workspaces":[".","examples/with-express","examples/with-fastify","examples/with-interop","examples/with-nextjs","examples/with-nextjs-app","examples/with-nuxtjs","examples/with-serverless"],"peerDependencies":{"@trpc/client":"^10.45.2","@trpc/server":"^10.45.2","zod":"^3.14.4"},"dependencies":{"chalk-scripts":"^1.2.8","co-body":"^6.1.0","lodash.clonedeep":"^4.5.0","node-mocks-http":"^1.14.1","openapi-types":"^12.1.3","zod-to-json-schema":"^3.23.0"},"devDependencies":{"@trpc/client":"^10.45.2","@trpc/server":"^10.45.2","@types/aws-lambda":"^8.10.138","@types/co-body":"^6.1.3","@types/express":"^4.17.21","@types/jest":"^29.5.12","@types/lodash.clonedeep":"^4.5.9","@types/mime":"^4.0.0","@types/node":"^20.12.13","@types/node-fetch":"^2.6.11","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","aws-lambda":"^1.0.7","eslint":"^8.57.0","eslint-config-airbnb":"19.0.4","eslint-plugin-import":"^2.29.1","eslint-plugin-jsx-a11y":"^6.8.0","eslint-plugin-promise":"^6.2.0","eslint-plugin-react":"^7.34.2","eslint-plugin-react-hooks":"^4.6.2","express":"^4.19.2","fastify":"^4.27.0","jest":"^29.7.0","mime":"^4.0.3","next":"^14.2.3","node-fetch":"^2.7.0","openapi-schema-validator":"^12.1.3","semver":"^7.6.2","superjson":"^1.13.3","ts-jest":"^29.1.4","ts-node":"^10.9.2","tsup":"^8.0.2","tsx":"^4.11.0","typescript":"^5.4.5","zod":"^3.23.8"},"tsup":{"entry":["packages/index.ts"],"outDir":"build","splitting":true,"sourcemap":true,"clean":true},"_id":"@9or9/trpc-openapi@2.0.1","gitHead":"86039fc9c3e634a8289248e362b02dd8fdeb8f18","_nodeVersion":"22.1.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ZWu5sYF1DGZY3oCHDtq3RqXyb/a6SX+Y5m0lVgJeg5OBWYcVCNLRq3a2YBk6NwNlzVgSWC5V0n2f1e/OXrlf0w==","shasum":"dc525413998d46b93f507d3d165eacfaf5966e43","tarball":"https://registry.npmjs.org/@9or9/trpc-openapi/-/trpc-openapi-2.0.1.tgz","fileCount":30,"unpackedSize":532485,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo8wkEwB1Lg8qKzfdKM8sm8HcqGXkCCJOXBV6CZPxUCQIhAJInABNYHABgjbxA6743V4YH3wN8Bf/pmWKFShkkWtyM"}]},"_npmUser":{"name":"denvey","email":"350132612@qq.com"},"directories":{},"maintainers":[{"name":"denvey","email":"350132612@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trpc-openapi_2.0.1_1721964863035_0.7868511104301397"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-26T03:28:58.449Z","modified":"2024-07-26T03:34:23.405Z","2.0.0":"2024-07-26T03:28:58.735Z","2.0.1":"2024-07-26T03:34:23.216Z"},"bugs":{"url":"https://github.com/9or9/trpc-openapi/issues"},"author":{"name":"https://github.com/denvey"},"license":"MIT","homepage":"https://github.com/9or9/trpc-openapi","repository":{"type":"git","url":"git+https://github.com/9or9/trpc-openapi.git"},"description":"tRPC openapi","maintainers":[{"name":"denvey","email":"350132612@qq.com"}],"readme":"![trpc-openapi](assets/trpc-swagger-readme.png)\n\n<div align=\"center\">\n  <h1>trpc-openapi</h1>\n  <a href=\"https://www.npmjs.com/package/trpc-swagger\"><img src=\"https://img.shields.io/npm/v/trpc-swagger.svg?style=flat&color=brightgreen\" target=\"_blank\" /></a>\n  <a href=\"./LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-black\" /></a>\n  <a href=\"https://trpc.io/discord\" target=\"_blank\"><img src=\"https://img.shields.io/badge/chat-discord-blue.svg\" /></a>\n  <br />\n  <hr />\n</div>\n\n\n## **[Swagger](https://swagger.io/specification/) intigration for [tRPC](https://trpc.io/)** \n\n- Easy REST endpoints for your tRPC procedures.\n- Perfect for incremental adoption.\n- OpenAPI version 3.0.3.\n\n## Fork Notice\nThis is a trpc-openapi branch, which fixes the support for Next.js app router with trpc v11. It was forked from the [trpc-swagger](https://github.com/Vercjames/package-trpc-swagger/tree/master) branch and incorporates a patch from [@ethndotsh](https://github.com/jlalmes/trpc-openapi/issues/434#issuecomment-1947796449). Currently, there may be other issues, so a pull request (PR) has not been submitted.\n\n## Local Examples\nIf you've pulled the repo. you can run any of the example projects by first running these 2 commands:\n```\nyarn install\n```\n```\nyarn build\n```\nThen select a workspace\n```bash\nyarn workspace with-[WORKSPACE_NAME] run dev\n```\nErgo\n```yaml\nyarn workspace with-nextjs-app run dev\nyarn workspace with-nextjs-app run build\n```\n\n## Usage\n\n**1. Install `trpc-openapi `**\n\n```bash\nnpm install @9or9/trpc-openapi --save\n```\n```bash\nyarn add @9or9/trpc-openapi\n```\n```bash\npnpm add @9or9/trpc-openapi\n```\n```bash\nbun add @9or9/trpc-openapi\n```\n\n**2. Add `OpenApiMeta` to your tRPC instance**\n\n```typescript\n// @/server/trpc.ts\nimport { initTRPC } from '@trpc/server'\nimport { OpenApiMeta } from '@9or9/trpc-openapi'\n\n// VERC: This\nconst t = initTRPC.create()\n\n// VERC: Becomes\nconst t = initTRPC.meta<OpenApiMeta>().create()\n\n// VERC: Advanced create configs\nconst t = initTRPC.meta<OpenApiMeta>().create({ ... })\n```\n\n**3. Enable `openapi` support for a procedure.**\n\n\n```typescript\n// @/server/index.ts\nexport const appRouter = t.router({\n  sayHello: t.procedure\n    .meta({ \n      openapi: { method: 'GET', path: '/say-hello' } \n    })\n    .input(z.object({ \n      name: z.string() \n    }))\n    .output(z.object({ \n      greeting: z.string() \n    }))\n    .query(({ input }) => {\n      return { greeting: `Hello ${input.name}!` }\n    })\n})\n```\n\n**4. Generate an OpenAPI document.**\n\n```typescript\n// @/server/swagger.ts\nimport { generateOpenApiDocument } from '@9or9/trpc-openapi'\nimport { appRouter } from './appRouter'\n\n/* 👇 */\nexport const openApiDocument = generateOpenApiDocument(appRouter, {\n  title: 'tRPC Swagger',\n  version: '1.0.0', // consider making this pull version from package.json\n  baseUrl: 'http://localhost:3000', // consider making this dynamic\n  docsUrl: \"https://github.com/vercjames/package-trpc-swagger\",\n  tags: [\"tag1\", \"tag2\", \"tag3\", \"posts\"],\n})\n```\n\n**5. Add an `@9or9/trpc-openapi` handler to your app.**\n\nWe currently support adapters for [`Express`](http://expressjs.com/), [`Next.js`](https://nextjs.org/),  [`Next.js 14`](https://nextjs.org/), [`Serverless`](https://www.serverless.com/), [`Fastify`](https://www.fastify.io/), [`Nuxt`](https://nuxtjs.org/) & [`Node:HTTP`](https://nodejs.org/api/http.html).\n\n```typescript\nimport http from 'http'\nimport { createOpenApiHttpHandler } from '@9or9/trpc-openapi'\n\nimport { appRouter } from '../appRouter'\n\nconst server = http.createServer(createOpenApiHttpHandler({ router: appRouter })) /* 👈 */\n\nserver.listen(3000)\n```\n\n**6. Profit 🤑**\n\n```typescript\n// client.ts\nconst res = await fetch('http://localhost:3000/say-hello?name=Verc', { method: 'GET' })\nconst body = await res.json() /* { greeting: 'Hello Verc!' } */\n```\n\n## Requirements\n\n**Peer dependencies**\n\nYour application requires these 2 packages installed\n- [`tRPC`](https://github.com/trpc/trpc) Server v11 (`@trpc/server`) must be installed.\n- [`Zod`](https://github.com/colinhacks/zod) v3 (`zod@^3.14.4`) must be installed (recommended `^3.20.0`).\n\n\n**Procedure support**\n\nFor a procedure to support OpenAPI the following _must_ be true:\n\n- Both `input` and `output` parsers are present AND use `Zod` validation.\n- Query `input` parsers extend `Object<{ [string]: String | Number | BigInt | Date }>` or `Void`.\n- Mutation `input` parsers extend `Object<{ [string]: AnyType }>` or `Void`.\n- `meta.openapi.method` is `GET`, `POST`, `PATCH`, `PUT` or `DELETE`.\n- `meta.openapi.path` is a string starting with `/`.\n- `meta.openapi.path` parameters exist in `input` parser as `String | Number | BigInt | Date`\n\nPlease note:\n\n- Data [`transformers`](https://trpc.io/docs/data-transformers) (such as `superjson`) are ignored.\n- Trailing slashes are ignored.\n- Routing is case-insensitive.\n\n## HTTP Requests\n\nProcedures with a `GET`/`DELETE` method will accept inputs via URL `query parameters`. Procedures with a `POST`/`PATCH`/`PUT` method will accept inputs via the `request body` with a `application/json` or `application/x-www-form-urlencoded` content type.\n\n### Path parameters\n\nA procedure can accept a set of inputs via URL path parameters. You can add a path parameter to any OpenAPI procedure by using curly brackets around an input name as a path segment in the `meta.openapi.path` field.\n\n### Query parameters\n\nQuery & path parameter inputs are always accepted as a `string`. This library will attempt to [coerce](https://github.com/colinhacks/zod#coercion-for-primitives) your input values to the following primitive types out of the box: `number`, `boolean`, `bigint` and `date`. If you wish to support others such as `object`, `array` etc. please use [`z.preprocess()`](https://github.com/colinhacks/zod#preprocess).\n\n```typescript\n// Router\nexport const appRouter = t.router({\n  sayHello: t.procedure\n    .meta({ openapi: { method: 'GET', path: '/say-hello/{name}' /* 👈 */ } })\n    .input(z.object({ name: z.string() /* 👈 */, greeting: z.string() }))\n    .output(z.object({ greeting: z.string() }))\n    .query(({ input }) => {\n      return { greeting: `${input.greeting} ${input.name}!` }\n    })\n})\n\n// Client\nconst res = await fetch('http://localhost:3000/say-hello/Verc?greeting=Hello' /* 👈 */, {\n  method: 'GET',\n})\nconst body = await res.json() /* { greeting: 'Hello Verc!' } */\n```\n\n### Request body\n\n```typescript\n// Router\nexport const appRouter = t.router({\n  sayHello: t.procedure\n    .meta({ openapi: { method: 'POST', path: '/say-hello/{name}' /* 👈 */ } })\n    .input(z.object({ name: z.string() /* 👈 */, greeting: z.string() }))\n    .output(z.object({ greeting: z.string() }))\n    .mutation(({ input }) => {\n      return { greeting: `${input.greeting} ${input.name}!` }\n    })\n})\n\n// Client\nconst res = await fetch('http://localhost:3000/say-hello/Verc' /* 👈 */, {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({ greeting: 'Hello' }),\n})\nconst body = await res.json() /* { greeting: 'Hello Verc!' } */\n```\n\n### Custom headers\n\nAny custom headers can be specified in the `meta.openapi.headers` array, these headers will not be validated on request. Please consider using [Authorization](#authorization) for first-class OpenAPI auth/security support.\n\n## HTTP Responses\n\nStatus codes will be `200` by default for any successful requests. In the case of an error, the status code will be derived from the thrown `TRPCError` or fallback to `500`.\n\nYou can modify the status code or headers for any response using the `responseMeta` function. Extra responses can be documented in the `meta.openapi.extraResponses` field.\n\n```typescript\n// Router\nexport const appRouter = t.router({\n  sayHello: t.procedure\n    .meta({ openapi: {\n      method: 'POST',\n      path: '/say-hello/{name}',\n      extraResponses: {\n          400: {\n            description: 'Bad request',\n            content: z.object({ reason: z.string().describe(\"The reason\") }),\n          },\n      }\n    }})\n    .input(z.object({ name: z.string(), greeting: z.string() }))\n    .output(z.object({ greeting: z.string() }))\n    .mutation(({ input }) => {\n      return { greeting: `${input.greeting} ${input.name}!` }\n    })\n})\n\n```\n\nPlease see [error status codes here](packages/adapters/node-http/errors.ts).\n\n## Authorization\n\nTo create protected endpoints, add `protect: true` to the `meta.openapi` object of each tRPC procedure. By default, you can then authenticate each request with the `createContext` function using the `Authorization` header with the `Bearer` scheme. If you wish to authenticate requests using a different/additional methods (such as custom headers, or cookies) this can be overwritten by specifying `securitySchemes` object.\n\nExplore a [complete example here](examples/with-nextjs/src/server/router.ts).\n\n#### Server\n\n```typescript\nimport { TRPCError, initTRPC } from '@trpc/server'\nimport { OpenApiMeta } from '@9or9/trpc-openapi'\n\ntype User = { id: string, name: string }\n\nconst users: User[] = [\n  {\n    id: 'usr_123',\n    name: 'Verc',\n  },\n]\n\nexport type Context = { user: User | null }\n\nexport const createContext = async ({ req, res }): Promise<Context> => {\n  let user: User | null = null\n  if (req.headers.authorization) {\n    const userId = req.headers.authorization.split(' ')[1]\n    user = users.find((_user) => _user.id === userId)\n  }\n  return { user }\n}\n\nconst t = initTRPC.context<Context>().meta<OpenApiMeta>().create()\n\nexport const appRouter = t.router({\n  sayHello: t.procedure\n    .meta({ openapi: { method: 'GET', path: '/say-hello', protect: true /* 👈 */ } })\n    .input(z.void()) // no input expected\n    .output(z.object({ greeting: z.string() }))\n    .query(({ input, ctx }) => {\n      if (!ctx.user) {\n        throw new TRPCError({ message: 'User not found', code: 'UNAUTHORIZED' })\n      }\n      return { greeting: `Hello ${ctx.user.name}!` }\n    }),\n})\n```\n\n#### Client\n\n```typescript\nconst res = await fetch('http://localhost:3000/say-hello', {\n  method: 'GET',\n  headers: { Authorization: 'Bearer usr_123' } /* 👈 */,\n})\nconst body = await res.json() /* { greeting: 'Hello Verc!' } */\n```\n\n## Examples\n\n_For advanced use-cases, please find examples in our [complete test suite](tests)._\n\n#### With Express\n\nPlease see [full example here](examples/with-express).\n\n```typescript\nimport { createExpressMiddleware } from '@trpc/server/adapters/express'\nimport express from 'express'\nimport { createOpenApiExpressMiddleware } from '@9or9/trpc-openapi'\n\nimport { appRouter } from '../appRouter'\n\nconst app = express()\n\napp.use('/api/trpc', createExpressMiddleware({ router: appRouter }))\napp.use('/api', createOpenApiExpressMiddleware({ router: appRouter })) /* 👈 */\n\napp.listen(3000)\n```\n\n#### With Next.js\n\nPlease see [full example here](examples/with-nextjs).\n\n```typescript\n// pages/api/[...trpc].ts\nimport { createOpenApiNextHandler } from '@9or9/trpc-openapi'\n\nimport { appRouter } from '../../server/appRouter'\n\nexport default createOpenApiNextHandler({ router: appRouter })\n```\n\n#### With AWS Lambda\n\nPlease see [full example here](examples/with-serverless).\n\n```typescript\nimport { createOpenApiAwsLambdaHandler } from '@9or9/trpc-openapi'\n\nimport { appRouter } from './appRouter'\n\nexport const openApi = createOpenApiAwsLambdaHandler({ router: appRouter })\n```\n\n#### With Fastify\n\nPlease see [full example here](examples/with-fastify).\n\n```typescript\nimport { fastifyTRPCPlugin } from '@trpc/server/adapters/fastify'\nimport Fastify from 'fastify'\nimport { fastifyTRPCOpenApiPlugin } from '@9or9/trpc-openapi'\n\nimport { appRouter } from './router'\n\nconst fastify = Fastify()\n\nasync function main() {\n  await fastify.register(fastifyTRPCPlugin, { router: appRouter })\n  await fastify.register(fastifyTRPCOpenApiPlugin, { router: appRouter }) /* 👈 */\n\n  await fastify.listen({ port: 3000 })\n}\n\nmain()\n```\n\n## Types\n\n#### GenerateOpenApiDocumentOptions\n\nPlease see [full typings here](packages/generator/index.ts).\n\n| Property          | Type                                   | Description                                             | Required |\n| ----------------- | -------------------------------------- | ------------------------------------------------------- | -------- |\n| `title`           | `string`                               | The title of the API.                                   | `true`   |\n| `description`     | `string`                               | A short description of the API.                         | `false`  |\n| `version`         | `string`                               | The version of the OpenAPI document.                    | `true`   |\n| `baseUrl`         | `string`                               | The base URL of the target server.                      | `true`   |\n| `docsUrl`         | `string`                               | A URL to any external documentation.                    | `false`  |\n| `tags`            | `string[]`                             | A list for ordering endpoint groups.                    | `false`  |\n| `securitySchemes` | `Record<string, SecuritySchemeObject>` | Defaults to `Authorization` header with `Bearer` scheme | `false`  |\n\n#### OpenApiMeta\n\nPlease see [full typings here](packages/types.ts).\n\n| Property         | Type                               | Description                                                                                                        | Required | Default                |\n| ---------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ---------------------- |\n| `enabled`        | `boolean`                          | Exposes this procedure to `@9or9/trpc-openapi` adapters and on the OpenAPI document.                                     | `false`  | `true`                 |\n| `method`         | `HttpMethod`                       | HTTP method this endpoint is exposed on. Value can be `GET`, `POST`, `PATCH`, `PUT` or `DELETE`.                   | `true`   | `undefined`            |\n| `path`           | `string`                           | Pathname this endpoint is exposed on. Value must start with `/`, specify path parameters using `{}`.               | `true`   | `undefined`            |\n| `protect`        | `boolean`                          | Requires this endpoint to use a security scheme.                                                                   | `false`  | `false`                |\n| `summary`        | `string`                           | A short summary of the endpoint included in the OpenAPI document.                                                  | `false`  | `undefined`            |\n| `description`    | `string`                           | A verbose description of the endpoint included in the OpenAPI document.                                            | `false`  | `undefined`            |\n| `tags`           | `string[]`                         | A list of tags used for logical grouping of endpoints in the OpenAPI document.                                     | `false`  | `undefined`            |\n| `headers`        | `ParameterObject[]`                | An array of custom headers to add for this endpoint in the OpenAPI document.                                       | `false`  | `undefined`            |\n| `contentTypes`   | `ContentType[]`                    | A set of content types specified as accepted in the OpenAPI document.                                              | `false`  | `['application/json']` |\n| `extraResponses` | `ResponsesObject`* | An array of custom responses to add for this endpoint in the OpenAPI document in addition to the default response. | `false`  | `undefined`            |\n| `deprecated`     | `boolean`                          | Whether or not to mark an endpoint as deprecated                                                                   | `false`  | `false`                |\n\n* _The `content` field in ResponsesObject is expected to be a `z.ZodType`_\n\n#### CreateOpenApiNodeHttpHandlerOptions\n\nPlease see [full typings here](packages/adapters/node-http/core.ts).\n\n| Property        | Type       | Description                                            | Required |\n| --------------- | ---------- | ------------------------------------------------------ | -------- |\n| `router`        | `Router`   | Your application tRPC router.                          | `true`   |\n| `createContext` | `Function` | Passes contextual (`ctx`) data to procedure resolvers. | `false`  |\n| `responseMeta`  | `Function` | Returns any modifications to statusCode & headers.     | `false`  |\n| `onError`       | `Function` | Called if error occurs inside handler.                 | `false`  |\n| `maxBodySize`   | `number`   | Maximum request body size in bytes (default: 100kb).   | `false`  |\n\n---\n\n_Still using tRPC v9? See our [`.interop()`](examples/with-interop) example._\n\n## License\n\nDistributed under the MIT License. See LICENSE for more information.\n","readmeFilename":"README.md"}