API documentation tools (OpenAPI, Swagger) for v-hono-core framework.
- OpenAPI 3.0/3.1 specification support
- Swagger UI integration
- Interactive API documentation
- Fluent API for building specs
v install --git https://github.com/v-hono/v-hono-core
v install --git https://github.com/v-hono/v-hono-docsimport hono
import hono_docs
fn main() {
mut app := hono.Hono.new()
// Build OpenAPI specification
spec := hono_docs.OpenAPIBuilder.new()
.openapi('3.0.0')
.title('My API')
.version('1.0.0')
.path('/users')
.get(hono_docs.OpenAPIOperation{
summary: 'List users'
responses: {
'200': hono_docs.OpenAPIResponse{
description: 'Success'
}
}
})
.done()
.build()!
// Register OpenAPI endpoint
app.doc('/doc', spec)
// Serve Swagger UI
app.get('/ui', hono_docs.swagger_ui(hono_docs.SwaggerUIOptions{
url: '/doc'
title: 'API Documentation'
}))
app.listen(':3000')
}hono- Core framework
MIT