Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateParameterFromSecurityScheme(scheme *openapi3.SecuritySchemeRef) (*openapi3.Parameter, error)
- func GenerateRequestsFromSchema(schema *openapi3.T, opts formats.InputFormatOptions, ...) error
- func GetGlobalParamsForSecurityRequirement(schema *openapi3.T, requirement *openapi3.SecurityRequirements) ([]*openapi3.ParameterRef, error)
- func NewDownloader() formats.SpecDownloader
- type OpenAPIDownloader
- type OpenAPIFormat
Constants ¶
const (
DEFAULT_HTTP_SCHEME_HEADER = "Authorization"
)
Variables ¶
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.6.0
func NewDownloader() formats.SpecDownloader
NewDownloader creates a new OpenAPI downloader
Types ¶
type OpenAPIDownloader ¶ added in v3.6.0
type OpenAPIDownloader struct{}
OpenAPIDownloader implements the SpecDownloader interface for OpenAPI 3.0 specs
func (*OpenAPIDownloader) Download ¶ added in v3.6.0
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.6.0
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 (*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)