openapi

package
v0.0.0-...-72cc51b Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertSwaggerToOpenAPI

func ConvertSwaggerToOpenAPI(swaggerPath, outPath string) error

ConvertSwaggerToOpenAPI converts a swagger v2 file produced by swag into OpenAPI 3 and normalizes the security schemes for MCP consumption.

func GenerateSwagDocsContent

func GenerateSwagDocsContent(routes []Route) string

GenerateSwagDocsContent returns the generated Swag annotations used as input to swag init.

func LoadOpenAPI

func LoadOpenAPI(path string) (*openapi3.T, error)

LoadOpenAPI loads an OpenAPI 3 document from disk.

func NormalizeEchoPath

func NormalizeEchoPath(path string) string

NormalizeEchoPath converts Echo route params (:id) to OpenAPI params ({id}).

func PatchSecuritySchemes

func PatchSecuritySchemes(doc *openapi3.T)

PatchSecuritySchemes rewrites the generated schemes into explicit bearer schemes.

func ValidateRouteCoverage

func ValidateRouteCoverage(doc *openapi3.T, routes []Route) error

ValidateRouteCoverage ensures every registered route is present in the OpenAPI document.

Types

type Route

type Route struct {
	Method     string
	Path       string
	Parameters []string
}

Route is the normalized route shape used by the OpenAPI tooling.

func RegisteredRoutes

func RegisteredRoutes() ([]Route, error)

RegisteredRoutes returns the full HTTP surface registered by the Echo server.

Jump to

Keyboard shortcuts

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