parser

package
v0.48.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FetchTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

func ParseSpecURL added in v0.43.1

func ParseSpecURL(src string) (*url.URL, bool)

ParseSpecURL parses src as an http(s) URL. File paths return false, including Windows drive paths like C:\spec.yaml (the "C:" reads as a scheme, not http).

Types

type Loader

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

func NewLoader

func NewLoader(opts ...Option) *Loader

func (*Loader) Parse

func (l *Loader) Parse(
	ctx context.Context,
	path string,
	opts openapi.ParseOptions,
) (*model.Spec, error)

func (*Loader) Warnings added in v0.23.4

func (l *Loader) Warnings() []string

type Option added in v0.43.1

type Option func(*Loader)

func WithHTTPClient added in v0.43.1

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the client for fetching remote specs and external refs. nil keeps the package default.

Jump to

Keyboard shortcuts

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