What is the difference between `Zod OpenAPI` and `Hono OpenAPI`?
From reading the docs I can't tell why I should use one as opposed to the other. Can I use both? If so, how?
1 Reply
hono/openapi
is middleware that you can add to a vanilla hono app to generate an openapi spec. you need to bring your own validation, so you could use zod to define your schemas
hono/zod-openapi
is probably built on hono/api
, but it's more of an extension to hono itself
think of it as a zod implementation of hono/openapi
baked directly into hono
there's also a third option now
https://github.com/rhinobase/hono-openapi
it also tries to integrate more closely with the schema library, but it does so by extending the schema libraries rather than extending hono
so you can use it with a variety of libraries, and it allows for more incremental/piecemeal adoption
it was released recently, so it hasn't been through the wringer yet, but it should address some challenges users experience w hono/openapi
namely that it's sort of all-or-nothing per-app