fastify-zod icon indicating copy to clipboard operation
fastify-zod copied to clipboard

Compatibility issue with fastify-autoload route prefixing

Open alitnk opened this issue 2 years ago • 2 comments

fastify-autoload handles adding route prefix for the loaded plugins, but it doesn't work when it's used with this library.

For example, say the loaded plugin is in routes/auth/index.js:

fastify.get('/login', ...)

will turn into /auth/login but

fastify.zod.get('/login', ...)

does not get prefixed.

alitnk avatar Jan 07 '23 16:01 alitnk

Yeah and it doesn't even get the prefix defined in autoload. Absolute killer for me!

r0mankon avatar Feb 22 '23 11:02 r0mankon

I just tried played around by migrating my server to this and encountered this issue. This basically makes it implossible for me to adopt fastify-zod (getting FST_ERR_DUPLICATED_ROUTE due to this).

nikeee avatar May 15 '23 11:05 nikeee