v3

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentsLabel = "components"
	SchemasLabel    = "schemas"
)
View Source
const (
	ExamplesLabel = "examples"
	ExampleLabel  = "example"
	ValueLabel    = "value"
)
View Source
const (
	InfoLabel    = "info"
	ContactLabel = "contact"
	LicenseLabel = "license"
)
View Source
const (
	ImplicitLabel          = "implicit"
	PasswordLabel          = "password"
	ClientCredentialsLabel = "clientCredentials"
	AuthorizationCodeLabel = "authorizationCode"
)
View Source
const (
	ParametersLabel    = "parameters"
	RequestBodyLabel   = "requestBody"
	RequestBodiesLabel = "requestBodies"
	ResponsesLabel     = "responses"
	CallbacksLabel     = "callbacks"
)
View Source
const (
	SchemaLabel  = "schema"
	ContentLabel = "content"
)
View Source
const (
	PathsLabel   = "paths"
	GetLabel     = "get"
	PostLabel    = "post"
	PatchLabel   = "patch"
	PutLabel     = "put"
	DeleteLabel  = "delete"
	OptionsLabel = "options"
	HeadLabel    = "head"
	TraceLabel   = "trace"
)
View Source
const (
	LinksLabel   = "links"
	DefaultLabel = "default"
)
View Source
const (
	PropertiesLabel           = "properties"
	AdditionalPropertiesLabel = "additionalProperties"
	XMLLabel                  = "xml"
	ItemsLabel                = "items"
	AllOfLabel                = "allOf"
	AnyOfLabel                = "anyOf"
	OneOfLabel                = "oneOf"
	NotLabel                  = "not"
	DiscriminatorLabel        = "discriminator"
)
View Source
const (
	SecurityLabel        = "security"
	SecuritySchemesLabel = "securitySchemes"
	OAuthFlowsLabel      = "flows"
)
View Source
const (
	VariablesLabel = "variables"
	ServersLabel   = "servers"
	ServerLabel    = "server"
)
View Source
const (
	TagsLabel         = "tags"
	ExternalDocsLabel = "externalDocs"
)
View Source
const (
	EncodingLabel = "encoding"
)
View Source
const (
	HeadersLabel = "headers"
)

Variables

This section is empty.

Functions

func ExtractExampleValue

func ExtractExampleValue(exp *yaml.Node) any

func ExtractSchema

func ExtractSchema(root *yaml.Node, idx *index.SpecIndex) (*low.NodeReference[*SchemaProxy], error)

Types

type Callback

type Callback struct {
	Expression low.ValueReference[map[low.KeyReference[string]]low.ValueReference[*PathItem]]
	Extensions map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Callback) Build

func (cb *Callback) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Callback) FindExpression

func (cb *Callback) FindExpression(exp string) *low.ValueReference[*PathItem]

type Components

func (*Components) Build

func (co *Components) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Components) FindCallback

func (co *Components) FindCallback(callback string) *low.ValueReference[*Callback]

func (*Components) FindExample

func (co *Components) FindExample(example string) *low.ValueReference[*Example]

func (*Components) FindExtension

func (co *Components) FindExtension(ext string) *low.ValueReference[any]

func (*Components) FindHeader

func (co *Components) FindHeader(header string) *low.ValueReference[*Header]
func (co *Components) FindLink(link string) *low.ValueReference[*Link]

func (*Components) FindParameter

func (co *Components) FindParameter(response string) *low.ValueReference[*Parameter]

func (*Components) FindRequestBody

func (co *Components) FindRequestBody(requestBody string) *low.ValueReference[*RequestBody]

func (*Components) FindResponse

func (co *Components) FindResponse(response string) *low.ValueReference[*Response]

func (*Components) FindSchema

func (co *Components) FindSchema(schema string) *low.ValueReference[*SchemaProxy]

func (*Components) FindSecurityScheme

func (co *Components) FindSecurityScheme(sScheme string) *low.ValueReference[*SecurityScheme]

type Contact

type Contact struct {
	Name  low.NodeReference[string]
	URL   low.NodeReference[string]
	Email low.NodeReference[string]
}

func (*Contact) Build

func (c *Contact) Build(root *yaml.Node, idx *index.SpecIndex) error

type Discriminator

type Discriminator struct {
	PropertyName low.NodeReference[string]
	Mapping      map[low.KeyReference[string]]low.ValueReference[string]
}

func (*Discriminator) FindMappingValue

func (d *Discriminator) FindMappingValue(key string) *low.ValueReference[string]

type Encoding

type Encoding struct {
	ContentType   low.NodeReference[string]
	Headers       low.NodeReference[map[low.KeyReference[string]]low.ValueReference[*Header]]
	Style         low.NodeReference[string]
	Explode       low.NodeReference[bool]
	AllowReserved low.NodeReference[bool]
}

func (*Encoding) Build

func (en *Encoding) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Encoding) FindHeader

func (en *Encoding) FindHeader(hType string) *low.ValueReference[*Header]

type Example

type Example struct {
	Summary       low.NodeReference[string]
	Description   low.NodeReference[string]
	Value         low.NodeReference[any]
	ExternalValue low.NodeReference[string]
	Extensions    map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Example) Build

func (ex *Example) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Example) FindExtension

func (ex *Example) FindExtension(ext string) *low.ValueReference[any]

type ExternalDoc

type ExternalDoc struct {
	Description low.NodeReference[string]
	URL         low.NodeReference[string]
	Extensions  map[low.KeyReference[string]]low.ValueReference[any]
}

func (*ExternalDoc) Build

func (ex *ExternalDoc) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*ExternalDoc) FindExtension

func (ex *ExternalDoc) FindExtension(ext string) *low.ValueReference[any]

func (*Header) Build

func (h *Header) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Header) FindContent

func (h *Header) FindContent(ext string) *low.ValueReference[*MediaType]

func (*Header) FindExample

func (h *Header) FindExample(eType string) *low.ValueReference[*Example]

func (*Header) FindExtension

func (h *Header) FindExtension(ext string) *low.ValueReference[any]

type Info

type Info struct {
	Title          low.NodeReference[string]
	Description    low.NodeReference[string]
	TermsOfService low.NodeReference[string]
	Contact        low.NodeReference[*Contact]
	License        low.NodeReference[*License]
	Version        low.NodeReference[string]
}

func (*Info) Build

func (i *Info) Build(root *yaml.Node, idx *index.SpecIndex) error

type License

type License struct {
	Name low.NodeReference[string]
	URL  low.NodeReference[string]
}

func (*License) Build

func (l *License) Build(root *yaml.Node, idx *index.SpecIndex) error
type Link struct {
	OperationRef low.NodeReference[string]
	OperationId  low.NodeReference[string]
	Parameters   low.KeyReference[map[low.KeyReference[string]]low.ValueReference[string]]
	RequestBody  low.NodeReference[string]
	Description  low.NodeReference[string]
	Server       low.NodeReference[*Server]
	Extensions   map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Link) Build

func (l *Link) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Link) FindExtension

func (l *Link) FindExtension(ext string) *low.ValueReference[any]

func (*Link) FindParameter

func (l *Link) FindParameter(pName string) *low.ValueReference[string]

type MediaType

func (*MediaType) Build

func (mt *MediaType) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*MediaType) FindExample

func (mt *MediaType) FindExample(eType string) *low.ValueReference[*Example]

func (*MediaType) FindExtension

func (mt *MediaType) FindExtension(ext string) *low.ValueReference[any]

func (*MediaType) FindPropertyEncoding

func (mt *MediaType) FindPropertyEncoding(eType string) *low.ValueReference[*Encoding]

func (*MediaType) GetAllExamples

func (mt *MediaType) GetAllExamples() map[low.KeyReference[string]]low.ValueReference[*Example]

type OAuthFlow

type OAuthFlow struct {
	AuthorizationUrl low.NodeReference[string]
	TokenUrl         low.NodeReference[string]
	RefreshUrl       low.NodeReference[string]
	Scopes           low.KeyReference[map[low.KeyReference[string]]low.ValueReference[string]]
	Extensions       map[low.KeyReference[string]]low.ValueReference[any]
}

func (*OAuthFlow) Build

func (o *OAuthFlow) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*OAuthFlow) FindExtension

func (o *OAuthFlow) FindExtension(ext string) *low.ValueReference[any]

func (*OAuthFlow) FindScope

func (o *OAuthFlow) FindScope(scope string) *low.ValueReference[string]

type OAuthFlows

type OAuthFlows struct {
	Implicit          low.NodeReference[*OAuthFlow]
	Password          low.NodeReference[*OAuthFlow]
	ClientCredentials low.NodeReference[*OAuthFlow]
	AuthorizationCode low.NodeReference[*OAuthFlow]
	Extensions        map[low.KeyReference[string]]low.ValueReference[any]
}

func (*OAuthFlows) Build

func (o *OAuthFlows) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*OAuthFlows) FindExtension

func (o *OAuthFlows) FindExtension(ext string) *low.ValueReference[any]

type Operation

func (*Operation) Build

func (o *Operation) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Operation) FindCallback

func (o *Operation) FindCallback(callback string) *low.ValueReference[*Callback]

type Parameter

func (*Parameter) Build

func (p *Parameter) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Parameter) FindContent

func (p *Parameter) FindContent(cType string) *low.ValueReference[*MediaType]

func (*Parameter) FindExample

func (p *Parameter) FindExample(eType string) *low.ValueReference[*Example]

func (*Parameter) FindExtension

func (p *Parameter) FindExtension(ext string) *low.ValueReference[any]

type PathItem

func (*PathItem) Build

func (p *PathItem) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*PathItem) FindExtension

func (p *PathItem) FindExtension(ext string) *low.ValueReference[any]

type Paths

type Paths struct {
	PathItems  map[low.KeyReference[string]]low.ValueReference[*PathItem]
	Extensions map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Paths) Build

func (p *Paths) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Paths) FindExtension

func (p *Paths) FindExtension(ext string) *low.ValueReference[any]

func (*Paths) FindPath

func (p *Paths) FindPath(path string) *low.ValueReference[*PathItem]

type RequestBody

type RequestBody struct {
	Description low.NodeReference[string]
	Content     low.NodeReference[map[low.KeyReference[string]]low.ValueReference[*MediaType]]
	Required    low.NodeReference[bool]
	Extensions  map[low.KeyReference[string]]low.ValueReference[any]
}

func (*RequestBody) Build

func (rb *RequestBody) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*RequestBody) FindContent

func (rb *RequestBody) FindContent(cType string) *low.ValueReference[*MediaType]

func (*RequestBody) FindExtension

func (rb *RequestBody) FindExtension(ext string) *low.ValueReference[any]

type Response

func (*Response) Build

func (r *Response) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Response) FindContent

func (r *Response) FindContent(cType string) *low.ValueReference[*MediaType]

func (*Response) FindExtension

func (r *Response) FindExtension(ext string) *low.ValueReference[any]

func (*Response) FindHeader

func (r *Response) FindHeader(hType string) *low.ValueReference[*Header]
func (r *Response) FindLink(hType string) *low.ValueReference[*Link]

type Responses

type Responses struct {
	Codes   map[low.KeyReference[string]]low.ValueReference[*Response]
	Default low.NodeReference[*Response]
}

func (*Responses) Build

func (r *Responses) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Responses) FindResponseByCode

func (r *Responses) FindResponseByCode(code string) *low.ValueReference[*Response]

type Schema

type Schema struct {
	Title                low.NodeReference[string]
	MultipleOf           low.NodeReference[int]
	Maximum              low.NodeReference[int]
	ExclusiveMaximum     low.NodeReference[int]
	Minimum              low.NodeReference[int]
	ExclusiveMinimum     low.NodeReference[int]
	MaxLength            low.NodeReference[int]
	MinLength            low.NodeReference[int]
	Pattern              low.NodeReference[string]
	Format               low.NodeReference[string]
	MaxItems             low.NodeReference[int]
	MinItems             low.NodeReference[int]
	UniqueItems          low.NodeReference[int]
	MaxProperties        low.NodeReference[int]
	MinProperties        low.NodeReference[int]
	Required             low.NodeReference[[]low.ValueReference[string]]
	Enum                 low.NodeReference[[]low.ValueReference[string]]
	Type                 low.NodeReference[string]
	AllOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	OneOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	AnyOf                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Not                  low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Items                low.NodeReference[[]low.ValueReference[*SchemaProxy]]
	Properties           low.NodeReference[map[low.KeyReference[string]]low.ValueReference[*SchemaProxy]]
	AdditionalProperties low.NodeReference[any]
	Description          low.NodeReference[string]
	Default              low.NodeReference[any]
	Nullable             low.NodeReference[bool]
	Discriminator        low.NodeReference[*Discriminator]
	ReadOnly             low.NodeReference[bool]
	WriteOnly            low.NodeReference[bool]
	XML                  low.NodeReference[*XML]
	ExternalDocs         low.NodeReference[*ExternalDoc]
	Example              low.NodeReference[any]
	Deprecated           low.NodeReference[bool]
	Extensions           map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Schema) Build

func (s *Schema) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Schema) FindProperty

func (s *Schema) FindProperty(name string) *low.ValueReference[*SchemaProxy]

type SchemaProxy

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

func (*SchemaProxy) Build

func (sp *SchemaProxy) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*SchemaProxy) GetBuildError

func (sp *SchemaProxy) GetBuildError() error

func (*SchemaProxy) Schema

func (sp *SchemaProxy) Schema() *Schema

type SecurityRequirement

type SecurityRequirement struct {
	ValueRequirements []low.ValueReference[map[low.KeyReference[string]][]low.ValueReference[string]]
}

func (*SecurityRequirement) Build

func (sr *SecurityRequirement) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*SecurityRequirement) FindRequirement

func (sr *SecurityRequirement) FindRequirement(name string) []low.ValueReference[string]

type SecurityScheme

type SecurityScheme struct {
	Type             low.NodeReference[string]
	Description      low.NodeReference[string]
	Name             low.NodeReference[string]
	In               low.NodeReference[string]
	Scheme           low.NodeReference[string]
	BearerFormat     low.NodeReference[string]
	Flows            low.NodeReference[*OAuthFlows]
	OpenIdConnectUrl low.NodeReference[string]
	Extensions       map[low.KeyReference[string]]low.ValueReference[any]
}

func (*SecurityScheme) Build

func (ss *SecurityScheme) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*SecurityScheme) FindExtension

func (ss *SecurityScheme) FindExtension(ext string) *low.ValueReference[any]

type Server

func (*Server) Build

func (s *Server) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Server) FindVariable

func (s *Server) FindVariable(ext string) *low.ValueReference[*ServerVariable]

type ServerVariable

type ServerVariable struct {
	Enum        []low.NodeReference[string]
	Default     low.NodeReference[string]
	Description low.NodeReference[string]
}

type Tag

type Tag struct {
	Name         low.NodeReference[string]
	Description  low.NodeReference[string]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Extensions   map[low.KeyReference[string]]low.ValueReference[any]
}

func (*Tag) Build

func (t *Tag) Build(root *yaml.Node, idx *index.SpecIndex) error

func (*Tag) FindExtension

func (t *Tag) FindExtension(ext string) *low.ValueReference[any]

type XML

type XML struct {
	Name       low.NodeReference[string]
	Namespace  low.NodeReference[string]
	Prefix     low.NodeReference[string]
	Attribute  low.NodeReference[bool]
	Wrapped    low.NodeReference[bool]
	Extensions map[low.KeyReference[string]]low.ValueReference[any]
}

func (*XML) Build

func (x *XML) Build(root *yaml.Node) error

Jump to

Keyboard shortcuts

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