nestjs / docs.nestjs.com

The official documentation https://docs.nestjs.com 📕
MIT License
1.13k stars 1.62k forks source link

docs: incorrect Fastify middleware function parameter types #3024

Closed eltigerchino closed 1 month ago

eltigerchino commented 1 month ago

I'm submitting a...

Current behavior

I'm not sure if the function types are correct for the Fastify middleware example in the docs. It mentions using FastifyRequest['raw'] but that doesn't give me access to the req.originalUrl property (which exists).

Expected behavior

I think it should use the FastifyRequest type which does provide the autocomplete for originalUrl.

kamilmysliwiec commented 1 month ago

Fastify wraps the incoming req and res Node instances using the Request and Reply objects internally, but this is done after the middleware phase.

https://fastify.dev/docs/v3.29.x/Reference/Middleware/