parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package parser wraps ogen to parse an OpenAPI spec and extract IR operations along with x-mcp-* extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPExtensions

type MCPExtensions struct {
	// Exclude marks an operation as excluded from code generation.
	Exclude bool
}

MCPExtensions holds x-mcp-* extension values for a single operation.

type Result

type Result struct {
	// Operations are the IR operations produced by ogen's generator.
	Operations []*ir.Operation
	// Extensions maps an operation key (operationID or "METHOD /path")
	// to its x-mcp-* extensions extracted from the raw spec.
	Extensions map[string]MCPExtensions
	// RawSpec is the parsed ogen spec, retained so downstream consumers
	// can access components and spec metadata.
	RawSpec *ogen.Spec
}

Result holds the parsed output from an OpenAPI spec.

func Parse

func Parse(specBytes []byte) (*Result, error)

Parse parses an OpenAPI spec from raw bytes and returns IR operations with associated MCP extensions.

Jump to

Keyboard shortcuts

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