openapi

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package openapi translates OpenAPI 3.x and Swagger 2.0 into callable operations.

The translator does not write a parser: `kin-openapi` already resolves `$ref` (nested and external included), reads JSON and YAML, and understands 3.0 and 3.1; Swagger 2.0 comes in converted to 3. Writing that by hand costs a partial model — and whatever the model does not cover arrives impoverished at the other end.

Here each parameter's schema is handed over AS IT IS in the spec (enum, format, array items, nested objects): the reader is an LLM, and every field lost along the way is a call it has to guess at.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Operations

func Operations(ctx context.Context, doc *spec.Document, o Options) ([]core.Operation, error)

Operations translates the whole document.

Types

type Options

type Options struct {
	BaseURL        string // beats the spec's `servers`
	Auth           auth.Applier
	Client         *http.Client
	IncludePaths   []*regexp.Regexp
	ExcludePaths   []*regexp.Regexp
	IncludeMethods []string
	ExcludeMethods []string
	Headers        map[string]string // fixed headers on every call
}

Options are decisions made by whoever starts the server, not by the spec.

Jump to

Keyboard shortcuts

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