openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package openapi turns an OpenAPI 3 document into ir.Operations. This is the library's primary, framework-agnostic Source: most Go services already emit a swagger.json / openapi.yaml, so they can become an MCP server without importing anything into their app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source loads an OpenAPI document and exposes its operations.

func FromData

func FromData(data []byte) (*Source, error)

FromData parses an OpenAPI 3 spec from raw bytes (JSON or YAML).

func FromFile

func FromFile(path string) (*Source, error)

FromFile loads an OpenAPI 3 spec from a local path (JSON or YAML).

func FromURL

func FromURL(raw string) (*Source, error)

FromURL loads an OpenAPI 3 spec from a URL.

func FromV3Doc

func FromV3Doc(doc *openapi3.T) *Source

FromV3Doc wraps an already-parsed OpenAPI 3 document. It lets other sources (e.g. swaggo, which emits OpenAPI 2.0) reuse the same operation conversion after converting their spec to v3.

func (*Source) Operations

func (s *Source) Operations(_ context.Context) ([]ir.Operation, error)

Operations implements source.Source.

Jump to

Keyboard shortcuts

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