-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
Automatic Swagger Docs generation like Elysia or NestJS #2970
Comments
Same👍 |
Hi @a4arpon Is not Zod OpenAPI Hono enough? To generate the Sagger docs, we will need a third-party library since we don't have a built-in validator. It will be third-party middleware or a wrapper class. One of the ideas is Zod OpenAPI Hono. It's good. |
I think Zod OpenAPI Hono is enough, just create other router file for OpenAPI instead of just Hono Router, isn't it? |
What is the point to create a route zod value first then create the original route. But docs writing is nowadays a time consuming task. Sonner or later we need this automatic doc generation. We all appreciate your hard working and dedication for the framework. But we are asking you a little bit more. Can you please do this? 🫠. If it can be done then a lot's of time will be saved on development. Cause our company is using hono but doc writing is too too complicated for us. And many of us i mean hono users requesting this feature. |
As mentioned above, I can only say, please use Zod OpenAPI Hono. It is getting many users, such as Unkey is heavily using it. We don't have any plan for generating the Swagger document feature in the There is a historical background to this, and like you, there have been many requests for OpenAPI documentation features for a long time. I had always struggled with how to implement it, but we solved the problem by creating Zod OpenAPI Hono. So that is the answer. |
I understand. But how they implemented it https://deno.land/x/[email protected] I think danet has a feature to generate docs automatically. You can see it. I think you will get some ideas. I am looking at into it too |
This is the repo. https://github.com/Savory/Danet-Swagger/tree/main I think you can check it @yusukebe |
Hello @a4arpon. import { Hono } from 'hono'
import { swagger } from '@hono/swagger' // imaginary
const app = new Hono()
app.use(swagger())
app.get('/', (c) => {
return c.text('Hello Hono!')
})
export default app |
What is the feature you are proposing?
First I'm giving thank's to Hono team for creating this amazing framework. But now a days every modern framework has automatic doc generation feature. I love hono. It's great. But writing Doc separately is too time consuming for me. You can say we have hono/swagger with zod support but writing api like this is not also appropriate for me or my team. Framework now a days typebox or something this kind of package under the hood to create api automatically.
I am requesting Hono team if they can do this it will be very great. I have tried to do this but not successful. Api docs is very important for my team and We don't have enough times to create another doc or add zod to write apis.
Please if you can implement this feature it will be very great.
The text was updated successfully, but these errors were encountered: