Help us shape the future of Go! Take the 2026 Go Developer Survey

openapi

package
v3.4.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_HTTP_SCHEME_HEADER = "Authorization"
)

Variables

View Source
var (
	// ErrRecursive is when a schema is impossible to represent because it infinitely recurses.
	ErrRecursive = errors.New("Recursive schema")

	// ErrNoExample is sent when no example was found for an operation.
	ErrNoExample = errors.New("No example found")
)

Functions

func GenerateParameterFromSecurityScheme

func GenerateParameterFromSecurityScheme(scheme *openapi3.SecuritySchemeRef) (*openapi3.Parameter, error)

GenerateParameterFromSecurityScheme generates an example from a schema object

func GenerateRequestsFromSchema

func GenerateRequestsFromSchema(schema *openapi3.T, opts formats.InputFormatOptions, callback formats.ParseReqRespCallback) error

GenerateRequestsFromSchema generates http requests from an OpenAPI 3.0 document object

func GetGlobalParamsForSecurityRequirement

func GetGlobalParamsForSecurityRequirement(schema *openapi3.T, requirement *openapi3.SecurityRequirements) ([]*openapi3.ParameterRef, error)

GetGlobalParamsForSecurityRequirement returns the global parameters for a security requirement

func NewDownloader added in v3.4.7

func NewDownloader() formats.SpecDownloader

NewDownloader creates a new OpenAPI downloader

Types

type OpenAPIDownloader added in v3.4.7

type OpenAPIDownloader struct{}

OpenAPIDownloader implements the SpecDownloader interface for OpenAPI 3.0 specs

func (*OpenAPIDownloader) Download added in v3.4.7

func (d *OpenAPIDownloader) Download(urlStr, tmpDir string, httpClient *retryablehttp.Client) (string, error)

This function downloads an OpenAPI 3.0 spec from the given URL and saves it to tmpDir

func (*OpenAPIDownloader) SupportedExtensions added in v3.4.7

func (d *OpenAPIDownloader) SupportedExtensions() []string

SupportedExtensions returns the list of supported file extensions for OpenAPI

type OpenAPIFormat

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

OpenAPIFormat is a OpenAPI Schema File parser

func New

func New() *OpenAPIFormat

New creates a new OpenAPI format parser

func (*OpenAPIFormat) Name

func (j *OpenAPIFormat) Name() string

Name returns the name of the format

func (*OpenAPIFormat) Parse

func (j *OpenAPIFormat) Parse(input io.Reader, resultsCb formats.ParseReqRespCallback, filePath string) error

Parse parses the input and calls the provided callback function for each RawRequest it discovers.

func (*OpenAPIFormat) SetOptions

func (j *OpenAPIFormat) SetOptions(options formats.InputFormatOptions)

Jump to

Keyboard shortcuts

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