spec

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 11 Imported by: 0

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 top-level OpenAPI extension that contains Kusk options. If there's no extension found, an empty object will be returned.

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