Documentation ¶
Overview ¶
Package load loads OpenAPI specs from different sources like URLs, paths, globs and stdin Optionally, specs can be preprocessed after loading
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader interface { LoadFromURI(*url.URL) (*openapi3.T, error) LoadFromFile(string) (*openapi3.T, error) LoadFromStdin() (*openapi3.T, error) }
Loader interface includes the OAS load functions
type Option ¶
Option functions can be used to preprocess specs after loading them
func WithFlattenAllOf ¶
func WithFlattenAllOf() Option
WithFlattenAllOf returns SpecInfos with flattened allOf
func WithFlattenParams ¶
func WithFlattenParams() Option
WithFlattenParams returns SpecInfos with Common Parameters combined into operation parameters See here for Common Parameters definition: https://swagger.io/docs/specification/describing-parameters/
func WithLowercaseHeaders ¶
func WithLowercaseHeaders() Option
WithLowercaseHeaders returns SpecInfos with header names converted to lowercase
type SourceType ¶
type SourceType int
const ( SourceTypeStdin SourceType = iota SourceTypeURL SourceTypeFile )
type SpecInfo ¶
SpecInfo contains information about an OpenAPI spec and its metadata
func NewSpecInfo ¶
NewSpecInfo creates a SpecInfo from a local file path, a URL, or stdin
func NewSpecInfoFromGlob ¶
NewSpecInfoFromGlob creates SpecInfos from local files matching the specified glob parameter
func (*SpecInfo) GetVersion ¶
type SpecInfoPair ¶
func NewSpecInfoPair ¶
func NewSpecInfoPair(specInfo1, specInfo2 *SpecInfo) *SpecInfoPair
func (*SpecInfoPair) GetBaseVersion ¶
func (specInfoPair *SpecInfoPair) GetBaseVersion() string
func (*SpecInfoPair) GetRevisionVersion ¶
func (specInfoPair *SpecInfoPair) GetRevisionVersion() string