provider

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package provider is the boundary between the generator and the library that reads OpenAPI.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderPanic      = errors.New("provider panic")
	ErrParse              = errors.New("parse spec")
	ErrUnsupportedVersion = errors.New("unsupported OpenAPI version")
	ErrOverlay            = errors.New("apply overlay")
)

Functions

This section is empty.

Types

type ParseOptions

type ParseOptions struct {
	File      string
	Positions map[string]diag.Origin
}

ParseOptions holds the spec's file name and where its nodes start, by JSON pointer. Positions, taken before any transform, win over positions in the parsed bytes.

type Provider

type Provider interface {
	ApplyOverlay(ctx context.Context, data, overlay []byte) ([]byte, []diag.Diagnostic, error)
	Parse(ctx context.Context, data []byte, opts ParseOptions) (*spec.Document, []diag.Diagnostic, error)
}

Provider reads specs. Implementations never print; problems come back as diagnostics or errors.

Directories

Path Synopsis
Package libopenapi implements provider.Provider and is the only importer of libopenapi.
Package libopenapi implements provider.Provider and is the only importer of libopenapi.

Jump to

Keyboard shortcuts

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