openapi

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

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)

generateExampleFromSchema 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

Types

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 string, resultsCb formats.ParseReqRespCallback) 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