jlalmes / trpc-openapi

OpenAPI support for tRPC 🧩
https://www.npmjs.com/package/trpc-openapi
MIT License
2.12k stars 136 forks source link

Example with swagger not working #403

Closed popuguytheparrot closed 9 months ago

popuguytheparrot commented 9 months ago

with this code i got ts error and nothing render on /docs

await app.register(fastifySwagger, {
    routePrefix: '/docs',
    mode: 'static',
    specification: { document: openApiDocument },
    uiConfig: { displayOperationId: true },
    exposeRoute: true,
  });
bikoevD commented 9 months ago

Example from 5 months ago, fastify-swagger changed their API If you want it to work:

and something like this:

await server.register(fastifySwagger, {
    mode: "static",
    specification: { document: openApiDocument }
});
await server.register(fastifySwaggerUi, {
    routePrefix: "/docs"
});