parser

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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