base

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ExamplesLabel = "examples"
	ExampleLabel  = "example"
	ValueLabel    = "value"
)
View Source
const (
	InfoLabel    = "info"
	ContactLabel = "contact"
	LicenseLabel = "license"
)
View Source
const (
	PropertiesLabel           = "properties"
	AdditionalPropertiesLabel = "additionalProperties"
	XMLLabel                  = "xml"
	ItemsLabel                = "items"
	AllOfLabel                = "allOf"
	AnyOfLabel                = "anyOf"
	OneOfLabel                = "oneOf"
	NotLabel                  = "not"
	DiscriminatorLabel        = "discriminator"
	SchemaLabel               = "schema"
)
View Source
const (
	TagsLabel         = "tags"
	ExternalDocsLabel = "externalDocs"
	NameLabel         = "name"
	DescriptionLabel  = "description"
)

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 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 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]

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 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 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