oas

package
v0.0.0-...-993f9dd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFile

func ValidateFile(path string) error

Types

type BuildError

type BuildError struct {
	Err     error
	Content string
	Message string
}

func (BuildError) Error

func (e BuildError) Error() string

type CodeSample

type CodeSample struct {
	Lang   string `yaml:"lang"`
	Label  string `yaml:"label"`
	Source string `yaml:"source,omitempty"`
}

type ComposedSchema

type ComposedSchema struct {
	Metadata `yaml:"-"`
	AllOf    []*Schema `yaml:"allOf"`
}

func (*ComposedSchema) CustomName

func (c *ComposedSchema) CustomName() string

func (*ComposedSchema) RealName

func (c *ComposedSchema) RealName() string

func (*ComposedSchema) SetCustomName

func (c *ComposedSchema) SetCustomName(customName string)

type ExternalDoc

type ExternalDoc struct {
	Description string `yaml:",omitempty"`
	Url         string `yaml:"url,omitempty"`
}

type Flow

type Flow struct {
	AuthorizationURL string            `yaml:"authorizationUrl"`
	TokenURL         string            `yaml:"tokenUrl"`
	Scopes           map[string]string `yaml:"scopes"`
}
type Header struct {
	Description string `yaml:",omitempty"`
	Schema      Schema `yaml:",omitempty"`
}

type Info

type Info struct {
	Version     string            `yaml:"version"`
	Title       string            `yaml:"title"`
	Description string            `yaml:"description"`
	Contact     map[string]string `yaml:"contact,omitempty"`
	Licence     License           `yaml:"licence,omitempty"`
}

type License

type License struct {
	Name string `yaml:"name,omitempty"`
	Url  string `yaml:"url,omitempty"`
}

type MetaSchema

type MetaSchema interface {
	RealName() string
	CustomName() string
	SetCustomName(string)
}

type Metadata

type Metadata struct {
	RealName   string `yaml:"-"`
	CustomName string `yaml:"-"`
}

type OpenAPI

type OpenAPI struct {
	Openapi    string                 `yaml:"openapi"`
	Info       Info                   `yaml:"info"`
	Servers    []Server               `yaml:"servers,omitempty"`
	Paths      map[string]Path        `yaml:"paths,omitempty"`
	Tags       []Tag                  `yaml:"tags,omitempty"`
	Components map[string]interface{} `yaml:"components,omitempty"`
	Security   []map[string][]string  `yaml:"security,omitempty"`
	XGroupTags []interface{}          `yaml:"x-tagGroups,omitempty"`
	// contains filtered or unexported fields
}

func CombineOAS

func CombineOAS(adminOAS, storeOAS OpenAPI) OpenAPI

func NewOpenAPI

func NewOpenAPI() OpenAPI

func (*OpenAPI) AddOperation

func (spec *OpenAPI) AddOperation(Path, verb string, a operation)

func (*OpenAPI) Parse

func (spec *OpenAPI) Parse(Path string, parseVendors []string, vendorsPath string, exitNonZeroOnError bool, apiType string)

type Path

type Path map[string]operation

type RequestBody

type RequestBody struct {
	Description string             `yaml:"description,omitempty"`
	Required    bool               `yaml:"required,omitempty"`
	Content     map[string]content `yaml:"content"`
}

type Response

type Response struct {
	Content     map[string]content `yaml:"content"`
	Description string             `yaml:"description,omitempty"`
	Headers     map[string]Header  `yaml:"headers,omitempty"`
}

type Schema

type Schema struct {
	Metadata             `yaml:"-"`
	Description          string                 `yaml:"description,omitempty"`
	Nullable             *bool                  `yaml:"nullable,omitempty"`
	Required             []string               `yaml:"required,omitempty"`
	Type                 string                 `yaml:"type,omitempty"`
	Items                map[string]interface{} `yaml:"items,omitempty"`
	Format               string                 `yaml:"format,omitempty"`
	Ref                  string                 `yaml:"$ref,omitempty"`
	Enum                 []string               `yaml:"enum,omitempty"`
	Properties           map[string]*Schema     `yaml:"properties,omitempty"`
	AdditionalProperties *Schema                `yaml:"additionalProperties,omitempty"`
	OneOf                []Schema               `yaml:"oneOf,omitempty"`
	Example              interface{}            `yaml:"example,omitempty"`
}

func NewEntity

func NewEntity() Schema

func (*Schema) CustomName

func (s *Schema) CustomName() string

func (*Schema) RealName

func (s *Schema) RealName() string

func (*Schema) SetCustomName

func (s *Schema) SetCustomName(customName string)

type SecuritySchemes

type SecuritySchemes struct {
	Type   string          `yaml:"type,omitempty"`
	Flows  map[string]Flow `yaml:"flows,omitempty"`
	Scheme string          `yaml:"scheme,omitempty"`
}

type Server

type Server struct {
	URL         string                    `yaml:"url,omitempty"`
	Description string                    `yaml:"description,omitempty"`
	Variables   map[string]ServerVariable `yaml:"variables,omitempty"`
}

type ServerVariable

type ServerVariable struct {
	Default     string   `yaml:"default,omitempty"`
	Enum        []string `yaml:"enum,omitempty"`
	Description string   `yaml:"description,omitempty"`
}

type Tag

type Tag struct {
	Name        string `yaml:"name,omitempty"`
	Description string `yaml:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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