openapi

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package openapi generates and validates OpenAPI 3.1 JSON from routes metadata. Package openapi 根据 routes 元数据生成并校验 OpenAPI 3.1 JSON。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(routeList []routes.Route, opts Options) ([]byte, error)

Generate returns validated OpenAPI 3.1 JSON for routeList. Route paths must include their final prefixes and start with a single slash. Generate 返回 routeList 对应且已通过校验的 OpenAPI 3.1 JSON。 路由 path 必须包含最终前缀并以单个斜线开头。

Types

type Options

type Options struct {
	Title       string
	Version     string
	Description string
}

Options configures OpenAPI document generation. Title and Version are required. Options 配置 OpenAPI 文档生成。 Title 和 Version 必填。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL