openapi

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Summary     string               `yaml:"summary" json:"summary"`
	Description string               `yaml:"description" json:"description"`
	Parameters  Parameters           `yaml:"parameters" json:"parameters"`
	Tags        []string             `yaml:"tags" json:"tags,omitempty"`
	Responses   map[string]*Response `yaml:"responses" json:"responses"`
	OperationID string               `json:"operationId,omitempty"`
}

type Extension

type Extension struct {
	Base   string            `json:"base"`
	Fields []*ExtensionField `json:"fields"`
}

type ExtensionField

type ExtensionField struct {
	Name   string `json:"name"`
	Type   string `json:"type"`
	Number int    `json:"number"`
}

type Info

type Info struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Version     string `json:"version"`
}

type Model

type Model struct {
	Properties map[string]*Schema `json:"properties"`
	Name       string
	Depth      int
}

type Parameter

type Parameter struct {
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description"`
	Enum        []string `json:"enum,omitempty"`
	Format      string   `json:"format,omitempty"`
	In          string   `json:"in,omitempty"`
	Items       *Schema  `json:"items,omitempty"`
	Ref         string   `json:"$ref,omitempty"`
	Required    bool     `json:"required"`
	Schema      *Schema  `json:"schema,omitempty"`
	Type        string   `json:"type,omitempty"`
}

type Parameters

type Parameters []*Parameter

type Path

type Path struct {
	Get        *Endpoint  `json:"get,omitempty"`
	Put        *Endpoint  `json:"put,omitempty"`
	Post       *Endpoint  `json:"post,omitempty"`
	Patch      *Endpoint  `json:"patch,omitempty"`
	Delete     *Endpoint  `json:"delete,omitempty"`
	Parameters Parameters `json:"parameters,omitempty"`
}

type Response

type Response struct {
	Description string  `json:"description"`
	Schema      *Schema `json:"schema,omitempty"`
}

type Schema

type Schema struct {
	Description string `json:"description"`

	Ref    string   `json:"$ref,omitempty"`
	Type   string   `json:"type,omitempty"`
	Format string   `json:"format,omitempty"`
	Enum   []string `json:"enum,omitempty"`

	// objects
	Required   []string           `json:"required,omitempty"`
	Properties map[string]*Schema `json:"properties,omitempty"`

	// is an array
	Items *Schema `json:"items,omitempty"`

	Pattern   string `json:"pattern,omitempty"`
	MaxLength int    `json:"maxLength,omitempty"`
	MinLength int    `json:"minLength,omitempty"`
	Maximum   int    `json:"maximum,omitempty"`
	Minimum   int    `json:"minimum,omitempty"`
}

type Spec

type Spec struct {
	Swagger       string                `json:"swagger"`
	Info          Info                  `json:"info"`
	Host          string                `json:"host,omitempty"`
	Schemes       []string              `json:"schemes,omitempty"`
	BasePath      string                `json:"basePath,omitempty"`
	Produces      []string              `json:"produces,omitempty"`
	Paths         map[string]*Path      `json:"paths,omitempty"`
	Definitions   map[string]*Schema    `json:"definitions,omitempty"`
	Parameters    map[string]*Parameter `json:"parameters,omitempty"`
	Extensions    []*Extension          `json:"x-extensions,omitempty"`
	GlobalOptions map[string]string     `json:"x-global-options,omitempty"`
}

Jump to

Keyboard shortcuts

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