Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: incorrect Fastify middleware function parameter types #3024

Closed
1 of 5 tasks
eltigerchino opened this issue May 9, 2024 · 1 comment
Closed
1 of 5 tasks

docs: incorrect Fastify middleware function parameter types #3024

eltigerchino opened this issue May 9, 2024 · 1 comment

Comments

@eltigerchino
Copy link

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request (new chapter/page)
  • Support request => Please do not submit support request here, instead post your question on Stack Overflow.

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
Copy link
Member

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/

@nestjs nestjs locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants