Skip to content

v-hono/v-hono-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hono_docs

API documentation tools (OpenAPI, Swagger) for v-hono-core framework.

Features

  • OpenAPI 3.0/3.1 specification support
  • Swagger UI integration
  • Interactive API documentation
  • Fluent API for building specs

Installation

v install --git https://github.com/v-hono/v-hono-core
v install --git https://github.com/v-hono/v-hono-docs

Usage

import 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')
}

Dependencies

  • hono - Core framework

License

MIT

About

Automated OpenAPI (Swagger) documentation generator for v-hono.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors