spec

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOptions

func GetOptions(spec *openapi3.T) (*options.Options, error)

GetOptions would retrieve and parse x-kusk OpenAPI extension that contains Kusk options. If there's no extension found, an empty object will be returned. For each found method in the document top and path level x-kusk options will be merged in to form OperationFinalSubOptions map that has the complete configuration for each method.

Types

type Loader

type Loader interface {
	LoadFromURI(location *url.URL) (*openapi3.T, error)
	LoadFromFile(location string) (*openapi3.T, error)
}

type Parser

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

func NewParser

func NewParser(loader Loader) Parser

func (Parser) Parse

func (p Parser) Parse(path string) (*openapi3.T, error)

Parse is the entrypoint for the spec package Accepts a path that should be parseable into a resource locater i.e. a URL or relative file path

func (Parser) ParseFromReader

func (p Parser) ParseFromReader(contents io.Reader) (*openapi3.T, error)

ParseFromReader allows for providing your own Reader implementation to parse the API spec from

Jump to

Keyboard shortcuts

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