samchungy / fastify-zod-openapi

Fastify plugin for zod-openapi
MIT License
57 stars 7 forks source link

Support Fastify 5 #155

Closed dmuharemagic closed 1 month ago

dmuharemagic commented 1 month ago

Hi!

Fastify v5 was recently released.

Notably, it includes a breaking change to the FastifyTypeProvider interface, and now requires NodeJS version >= 20.

This PR includes the refactoring needed to support the aforementioned release.

I'm curious about the changes in the test snapshots, so we'll definitely need to look into it - looks weird at first. Could be that something needs to be changed in the transformer. Will circle back to it. Seems that omitting the properties key from FastifyResponseSchema did the trick :) Seems to be correlated with the @fastify/swagger changes in v9.

If there's anything else left to do, feel free to let me know.

Thanks!

samchungy commented 1 month ago

Amazing, thank you! I was looking into this yesterday but you've beat me to the punch