spec

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidatorForOpenAPI3Schema

func GetValidatorForOpenAPI3Schema(oaiSchema *Schema, components *ComponentsForValidation) (*jsval.JSVal, error)

Types

type Components

type Components struct {
	Schemas map[string]*Schema `json:"schemas" yaml:"schemas"`
}

type ComponentsForValidation

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

func GetComponentsForValidation

func GetComponentsForValidation(components *Components) *ComponentsForValidation

type ExpansionResources

type ExpansionResources struct {
	OneOf []*Schema `json:"oneOf" yaml:"oneOf"`
}

type Fixtures

type Fixtures struct {
	Resources map[ResourceID]interface{} `json:"resources" yaml:"resources"`
}

type HTTPVerb

type HTTPVerb string

type MediaType

type MediaType struct {
	Schema *Schema `json:"schema" yaml:"schema"`
}

type Operation

type Operation struct {
	Description string                  `json:"description" yaml:"description"`
	OperationID string                  `json:"operation_id" yaml:"operation_id"`
	Parameters  []*Parameter            `json:"parameters" yaml:"parameters"`
	RequestBody *RequestBody            `json:"requestBody" yaml:"requestBody"`
	Responses   map[StatusCode]Response `json:"responses" yaml:"responses"`
}

type Parameter

type Parameter struct {
	Description string  `json:"description" yaml:"description"`
	In          string  `json:"in" yaml:"in"`
	Name        string  `json:"name" yaml:"name"`
	Required    bool    `json:"required" yaml:"required"`
	Schema      *Schema `json:"schema" yaml:"schema"`
}

type Path

type Path string

type RequestBody

type RequestBody struct {
	Content  map[string]MediaType `json:"content" yaml:"content"`
	Required bool                 `json:"required" yaml:"required"`
}

type ResourceID

type ResourceID string

type Response

type Response struct {
	Description string               `json:"description" yaml:"description"`
	Content     map[string]MediaType `json:"content" yaml:"content"`
}

type Schema

type Schema struct {
	AnyOf      []*Schema          `json:"anyOf,omitempty" yaml:"anyOf"`
	Enum       []string           `json:"enum,omitempty" yaml:"enum"`
	Items      *Schema            `json:"items,omitempty" yaml:"items"`
	Nullable   bool               `json:"nullable,omitempty" yaml:"nullable"`
	Properties map[string]*Schema `json:"properties,omitempty" yaml:"properties"`
	Required   []string           `json:"required,omitempty" yaml:"required"`
	Type       string             `json:"type,omitempty" yaml:"type"`

	// Ref is populated if this JSON Schema is actually a JSON reference, and
	// it defines the location of the actual schema definition.
	Ref string `json:"$ref,omitempty" yaml:"$ref"`

	XExpandableFields   *[]string           `json:"x-expandableFields,omitempty" yaml:"x-expandableFields"`
	XExpansionResources *ExpansionResources `json:"x-expansionResources,omitempty" yaml:"x-expansionResources"`
	XResourceID         string              `json:"x-resourceId,omitempty" yaml:"x-resourceId"`
}

func (*Schema) String

func (s *Schema) String() string

func (*Schema) UnmarshalJSON

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

type Spec

type Spec struct {
	Components Components                       `json:"components" yaml:"components"`
	Paths      map[Path]map[HTTPVerb]*Operation `json:"paths" yaml:"paths"`
}

type StatusCode

type StatusCode string

Jump to

Keyboard shortcuts

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