How to generate openapi.yaml spec with Zod OpenAPI Hono?

Is it possible to generate the openapi.yaml spec with Zod OpenAPI Hono from the commandline using a npm command? I need this in my development workflow to use the openapi.yaml to generate some other client code from the spec.
3 Replies
ex0ns
ex0ns8mo ago
You can call
app.getOpenAPIDocument( {
openapi: '3.0.0',
info: {
version: '1.0.0',
title: 'My API',
},
}))
app.getOpenAPIDocument( {
openapi: '3.0.0',
info: {
version: '1.0.0',
title: 'My API',
},
}))
On your hono to retrieve the document, from there you can probably write it to your filesystem or use it in your build system
Arthur
Arthur8mo ago
just create a script for it
Marcel Overdijk
Marcel OverdijkOP8mo ago
GitHub
Standalone openapi yaml schema generation · Issue #142 · cloudflare...
Is it possible to generate a openapi yaml schema file from the command line? Eg running a npm command? Without the server running. Rationale: In development workflow I would like to generate the ya...
Want results from more Discord servers?
Add your server