Extend FastifyRequest using FastifyPluginAsyncTypebox
Open
help wanted
- Dominant language
- No language data
- Stars
- 68
- Forks
- 8
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 2
Description
## 💬 Question here
Hey, i'm trying to extend FastifyRequest while using type-provider-typebox.
```ts
let fastify = Fastify(opts).withTypeProvider();
// then in another file
const route: FastifyPluginAsyncTypebox = async (instance, opts) => {
instance.register((request, reply) => {
request.user; // not defined
});
}
// maybe the solution is something like this but I'm not sure how:
// fastify.d.ts
declare module "fastify" {
export type FastifyNewRoute = FastifyPluginAsyncTypebox & {
instance: FastifyInstance... // now sure what to do next
};
}
````
Contributor guide
Assessment
This issue has not been assessed yet.