-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
fix: properly handle missing schema if route is not defined #6650
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
Looks like `request.routeSchema` will be deprecated (runtime only warning) (node:7) [FSTDEP015] DeprecationWarning: You are accessing the deprecated "request.routeSchema" property. Use "request.routeOptions.schema" instead. Property "req.routeSchema" will be removed in `fastify@5`.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6650 +/- ##
=========================================
Coverage 61.69% 61.69%
=========================================
Files 556 556
Lines 58820 58820
Branches 1887 1887
=========================================
Hits 36287 36287
Misses 22492 22492
Partials 41 41 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth creating an issue on fastify repo too
Done fastify/fastify#5393 |
🎉 This PR is included in v1.18.0 🎉 |
Motivation
Follow up to previous PR #6626 which improves handling of missing schema if route is not defined.
The type provided by fastify is not correct as schema might be
undefined
which results in an uncaught exception if you call a route that does not exist.We also had a type cast previously which was not correct and result in unlabeled metrics if someone called a route that does not exist.
Description
Properly handle missing schema if route is not defined