apischema

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	ID            string      `json:"id,omitempty"`
	Name          string      `json:"name,omitempty"`
	Description   string      `json:"description,omitempty"`
	Authenticator string      `json:"authenticator,omitempty"`
	RouteSet      *RouteSet   `json:"route_set,omitempty"`
	Scopes        []*APIScope `json:"scopes,omitempty"`
}

type APIScope

type APIScope struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type Argument

type Argument struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
	Required    bool   `json:"required,omitempty"`
	Array       bool   `json:"array,omitempty"`
	Default     string `json:"default,omitempty"`
}

type ArgumentSet

type ArgumentSet struct {
	ID          string      `json:"id,omitempty"`
	Name        string      `json:"name,omitempty"`
	Description string      `json:"description,omitempty"`
	Arguments   []*Argument `json:"arguments,omitempty"`
}

type Controller

type Controller struct {
	ID            string                `json:"id,omitempty"`
	Name          string                `json:"name,omitempty"`
	Description   string                `json:"description,omitempty"`
	Authenticator string                `json:"authenticator,omitempty"`
	Endpoints     []*ControllerEndpoint `json:"endpoints,omitempty"`
}

type ControllerEndpoint

type ControllerEndpoint struct {
	Name     string `json:"name,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

type Endpoint

type Endpoint struct {
	ID              string       `json:"id,omitempty"`
	Name            string       `json:"name,omitempty"`
	Description     string       `json:"description,omitempty"`
	HTTPStatus      int          `json:"http_status,omitempty"`
	Authenticator   string       `json:"authenticator,omitempty"`
	ArgumentSet     *ArgumentSet `json:"argument_set,omitempty"`
	Fields          []*Field     `json:"fields,omitempty"`
	PotentialErrors []string     `json:"potential_errors,omitempty"`
	Scopes          []string     `json:"scopes,omitempty"`
}

type Enum

type Enum struct {
	ID          string       `json:"id,omitempty"`
	Name        string       `json:"name,omitempty"`
	Description string       `json:"description,omitempty"`
	Values      []*EnumValue `json:"values,omitempty"`
}

type EnumValue

type EnumValue struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type Error

type Error struct {
	ID          string   `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Code        string   `json:"code,omitempty"`
	HTTPStatus  int      `json:"http_status,omitempty"`
	Fields      []*Field `json:"fields,omitempty"`
}

type Field

type Field struct {
	ID          string     `json:"id,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Type        string     `json:"type,omitempty"`
	Null        bool       `json:"null,omitempty"`
	Array       bool       `json:"array,omitempty"`
	Spec        *FieldSpec `json:"spec,omitempty"`
}

type FieldSpec

type FieldSpec struct {
	All  bool   `json:"all,omitempty"`
	Spec string `json:"spec,omitempty"`
}

type Group

type Group struct {
	ID          string   `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Groups      []*Group `json:"groups,omitempty"`
}

type LookupArgumentSet

type LookupArgumentSet struct {
	ID              string      `json:"id,omitempty"`
	Name            string      `json:"name,omitempty"`
	Description     string      `json:"description,omitempty"`
	Arguments       []*Argument `json:"arguments,omitempty"`
	PotentialErrors []string    `json:"potential_errors,omitempty"`
}

type Object

type Object struct {
	ID          string   `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Fields      []*Field `json:"fields,omitempty"`
}

type Polymorph

type Polymorph struct {
	ID          string             `json:"id,omitempty"`
	Name        string             `json:"name,omitempty"`
	Description string             `json:"description,omitempty"`
	Options     []*PolymorphOption `json:"options,omitempty"`
}

type PolymorphOption

type PolymorphOption struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type RawObject

type RawObject struct {
	Type  string
	Value json.RawMessage
}

type Route

type Route struct {
	Path          string `json:"path,omitempty"`
	RequestMethod string `json:"request_method,omitempty"`
	Controller    string `json:"controller,omitempty"`
	Endpoint      string `json:"endpoint,omitempty"`
	Group         string `json:"group,omitempty"`
}

type RouteSet

type RouteSet struct {
	Routes []*Route `json:"routes,omitempty"`
	Groups []*Group `json:"groups,omitempty"`
}

type Scalar

type Scalar struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type Schema

type Schema struct {
	SchemaVersion int          `json:"schema_version"`
	Host          string       `json:"host,omitempty"`
	Namespace     string       `json:"namespace,omitempty"`
	API           string       `json:"api,omitempty"`
	RawObjects    []*RawObject `json:"objects,omitempty"`

	APIs               map[string]*API               `json:"-"`
	ArgumentSets       map[string]*ArgumentSet       `json:"-"`
	Controllers        map[string]*Controller        `json:"-"`
	Endpoints          map[string]*Endpoint          `json:"-"`
	Enums              map[string]*Enum              `json:"-"`
	Errors             map[string]*Error             `json:"-"`
	LookupArgumentSets map[string]*LookupArgumentSet `json:"-"`
	Objects            map[string]*Object            `json:"-"`
	Polymorphs         map[string]*Polymorph         `json:"-"`
	Scalars            map[string]*Scalar            `json:"-"`
}

func (*Schema) UnmarshalJSON

func (s *Schema) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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