Help us shape the future of Go! Take the 2026 Go Developer Survey

swagger

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package swagger 内嵌 OpenAPI 文档与 Swagger UI,服务启动即可浏览 API 文档。 路由:GET /swagger/ (UI)、GET /swagger/openapi.json (spec)。 spec 文件由 `go run ./cmd/apidoc` 从 idl/*.thrift 生成,`make apidoc` 同步更新。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenAPISpec

func OpenAPISpec(ctx context.Context, c *app.RequestContext)

OpenAPISpec 返回 OpenAPI 3.0 JSON spec。

func Spec added in v1.19.0

func Spec() []byte

Spec 返回内嵌的 OpenAPI 3.0 JSON 原文,供 CLI schema 自省等复用。

func SwaggerUI

func SwaggerUI(ctx context.Context, c *app.RequestContext)

SwaggerUI 渲染 Swagger UI 页面。

Types

This section is empty.

Jump to

Keyboard shortcuts

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