Deprecation Warning for reply.context
wiwild opened this issue · comments
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.24.3
Plugin version
5.2.0
Node.js version
18.16.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Debian 10
Description
Deprecation for use with reply. context :
[FSTDEP019] FastifyDeprecation: reply.context property access is deprecated. Please use "reply.routeOptions.config" or "reply.routeOptions.schema" instead for accessing Route settings. The "reply.context" will be removed in fastify@5
.
in index.js : line 23
if (reply.context.config.serializers) { // keep route level cache in config to prevent messing with global cache reply.context.config.serializers.cache = Object.assign({}, reply.context.config.serializers.cache) reply.serializer.serializerManager = SerializerManager.expand({ serializers: reply.context.config.serializers, cache: reply.context.config.serializers.cache }, globalSerializerManager) }
Steps to Reproduce
Launch any example will output the warning on each request
Expected Behavior
No deprecation warning
Hey!
Yeah, it will be removed so you should be using the provided alternatives
Where's the issue?
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
This can be closed due to #100