openapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Schemas       map[string]Schema
	Responses     map[string]Response
	RequestBodies map[string]RequestBody
}

type ExternalDocs

type ExternalDocs struct {
}

type Info

type Info struct {
	Title       string
	Description string
	Version     string
	License     struct {
		Name string
		Url  string
	}
}

type MediaType

type MediaType struct {
	Schema Schema
}

func (*MediaType) ResolveRefs

func (m *MediaType) ResolveRefs(basePath string, components *Components) error

type OpenAPI

type OpenAPI struct {
	OpenAPI    string
	Info       Info
	Servers    Servers
	Paths      Paths
	Components Components
}

func LoadOpenAPI

func LoadOpenAPI(openAPIFile string) (*OpenAPI, error)

func (*OpenAPI) ResolveRefs

func (o *OpenAPI) ResolveRefs(basePath string, components *Components) error

type Operation

type Operation struct {
	Tags         []string
	Summary      string
	Description  string
	Parameters   []Parameter
	RequestBody  RequestBody `yaml:"requestBody"`
	Responses    map[string]Response
	OperationId  string `yaml:"operationId"`
	ExternalDocs ExternalDocs
}

func (*Operation) ResolveRefs

func (o *Operation) ResolveRefs(basePath string, components *Components) error

type Parameter

type Parameter struct {
	Name            string
	In              string
	Description     string
	Required        bool
	AllowEmptyValue bool
	Schema          Schema
}

func (*Parameter) ResolveRefs

func (p *Parameter) ResolveRefs(basePath string, components *Components) error

type PathItem

type PathItem struct {
	Summary     string
	Description string
	Get         *Operation
	Post        *Operation
	Patch       *Operation
	Delete      *Operation
	Parameters  []Parameter
	Ref         string `yaml:"$ref"`
}

func (*PathItem) Operations

func (p *PathItem) Operations() map[string]*Operation

func (*PathItem) ResolveRefs

func (p *PathItem) ResolveRefs(basePath string, components *Components) error

type Paths

type Paths map[string]PathItem

func (*Paths) ResolveRefs

func (p *Paths) ResolveRefs(basePath string, components *Components) error

type RequestBody

type RequestBody struct {
	Description string
	Content     map[string]MediaType
	Required    bool
}

func (*RequestBody) ResolveRefs

func (r *RequestBody) ResolveRefs(basePath string, components *Components) error

type Response

type Response struct {
	Description string
	Content     map[string]MediaType
}

func (*Response) ResolveRefs

func (r *Response) ResolveRefs(basePath string, components *Components) error

type Schema

type Schema struct {
	Description          string
	Type                 string
	Properties           map[string]Schema
	Items                *Schema
	Ref                  string `yaml:"$ref"`
	AdditionalProperties bool
	Name                 string
	MinLength            int `yaml:"minLength"`
	MaxLength            int `yaml:"maxLength"`
}

func (*Schema) ResolveRefs

func (s *Schema) ResolveRefs(basePath string, components *Components) error

type Servers

type Servers []struct {
	Url string
}

Jump to

Keyboard shortcuts

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