openapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectInfo

type ObjectInfo struct {
	SchemaInfo
	// contains filtered or unexported fields
}

func (ObjectInfo) PropertiesInfos

func (o ObjectInfo) PropertiesInfos() []PropertyInformer

type ObjectInformer

type ObjectInformer interface {
	SchemaInformer

	// PropertiesInfos returns properties of the object
	PropertiesInfos() []PropertyInformer
}

type PropertyInfo

type PropertyInfo struct {
	SchemaInfo
}

func (PropertyInfo) Key

func (i PropertyInfo) Key() string

func (PropertyInfo) Optional

func (i PropertyInfo) Optional() bool

type PropertyInformer

type PropertyInformer interface {
	SchemaInformer

	// Key returns the object key name
	Key() string

	// Optional returns the value for the "optional" rule of the object property
	Optional() bool
}

type SchemaInfo

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

func NewJSchemaInfo

func NewJSchemaInfo(js *jschema.JSchema) SchemaInfo

func NewRSchemaInfo

func NewRSchemaInfo(rs *regex.RSchema) SchemaInfo

func (SchemaInfo) Annotation

func (e SchemaInfo) Annotation() string

func (SchemaInfo) Children

func (e SchemaInfo) Children() []schema.ASTNode

func (SchemaInfo) SchemaObject

func (e SchemaInfo) SchemaObject() SchemaObject

func (SchemaInfo) Type

func (e SchemaInfo) Type() SchemaInfoType

type SchemaInfoType

type SchemaInfoType int
const (
	SchemaInfoTypeRegex SchemaInfoType = iota
	SchemaInfoTypeObject
	SchemaInfoTypeArray
	SchemaInfoTypeScalar // string, integer, boolean, null
	SchemaInfoTypeAny
	SchemaInfoTypeReference
)

type SchemaInformer

type SchemaInformer interface {
	Type() SchemaInfoType

	// SchemaObject returns an OpenAPI Schema Object based on the JSight schema
	SchemaObject() SchemaObject

	// Annotation returns the JSight schema annotation
	Annotation() string
}

func Dereference

func Dereference(s schema.Schema) []SchemaInformer

type SchemaObject

type SchemaObject interface {
	SetDescription(s string)
	MarshalJSON() (b []byte, err error)
}

func NewSchemaObject

func NewSchemaObject(s schema.Schema) SchemaObject

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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