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
There are no type descriptions for server properties #3942
Comments
Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
By the way, they are not present at all in the instance of fastify const fastify = require('fastify')({
logger: true,
});
// Declare a route
fastify.get('/', function (req, reply) {
const { pluginName, validatorCompiler, serializerCompiler } = fastify;
req.log.info(`${typeof pluginName}, ${typeof validatorCompiler}, ${typeof serializerCompiler}`);
reply.send({ hello: 'world' });
}); here are the log entries {"level":30,"time":1653837768101,"pid":25388,"hostname":"WIN-40K96OG4L3A","msg":"Server listening at http://127.0.0.1:3000"}
{"level":30,"time":1653837770753,"pid":25388,"hostname":"WIN-40K96OG4L3A","reqId":"req-1","req":{"method":"GET","url":"/","hostname":"127.0.0.1:3000","remoteAddress":"127.0.0.1","remotePort":55850},"msg":"incoming request"}
{"level":30,"time":1653837770755,"pid":25388,"hostname":"WIN-40K96OG4L3A","reqId":"req-1","msg":"undefined, undefined, undefined"}
{"level":30,"time":1653837770770,"pid":25388,"hostname":"WIN-40K96OG4L3A","reqId":"req-1","res":{"statusCode":200},"responseTime":15.357467889785767,"msg":"request completed"} |
As for |
Signed-off-by: Matteo Collina <hello@matteocollina.com> Ref: #3942
Signed-off-by: Matteo Collina <hello@matteocollina.com> Ref: #3942
@Eomm could you look into |
Yes, those types are missing and only the input is mapped actually |
Hi, is @budarin working on this issue? If we need someone to work on it, I’m happy to help!! |
@TommyDew42 I think you can take it! |
Unfortunately I don't know enough about the internal implementation of fastify to solve this problem ( |
Looks like there is a merged PR for this. Should this issue be closed or is there more work to do on this? |
Prerequisites
Fastify version
4.0.0-rc.3
Description
There are no type descriptions for server properties:
pluginName
https://www.fastify.io/docs/latest/Reference/Server/#pluginname
validatorCompiler
https://www.fastify.io/docs/latest/Reference/Server/#validatorcompiler
serializerCompiler
https://www.fastify.io/docs/latest/Reference/Server/#serializercompiler
It is possible that other instance properties are not typed
Steps to Reproduce
Expected Behavior
Availability of type descriptions for the specified properties
The text was updated successfully, but these errors were encountered: