swagger2

package
v0.0.0-...-998eeed Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 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 Endpoint

type Endpoint struct {
	Tags        []string    `json:"tags,omitempty"`
	Summary     string      `json:"summary,omitempty"`
	OperationID string      `json:"operationId,omitempmty"`
	Description string      `json:"description,omitempty"`
	Consumes    []string    `json:"consumes,omitempty"`
	Produces    []string    `json:"produces,omitempty"`
	Parameters  []Parameter `json:"parameters"`
}

Endpoint represents a Swagger 2.0 spec endpoint object.

type Info

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

Info represents a Swagger 2.0 spec info object.

type Parameter

type Parameter struct {
	Name        string      `json:"name,omitempty"`
	Type        string      `json:"type,omitempty"`
	In          string      `json:"in,omitempty"`
	Description string      `json:"description,omitempty"`
	Required    bool        `json:"required,omitempty"`
	Default     interface{} `json:"default,omitempty"`
}

Parameter represents a Swagger 2.0 spec parameter object.

type Path

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

Path represents a Swagger 2.0 spec path object.

type Specification

type Specification struct {
	Host     string          `json:"host,omitempty"`
	Info     Info            `json:"info,omitempty"`
	BasePath string          `json:"basePath,omitempty"`
	Schemes  []string        `json:"schemes,omitempty"`
	Paths    map[string]Path `json:"paths,omitempty"`
}

Specification represents a Swagger 2.0 specification.

func NewSpecificationFromBytes

func NewSpecificationFromBytes(data []byte) (Specification, error)

NewSpecificationFromBytes returns a Swagger Specification from a byte array.

func ReadSwagger2Spec

func ReadSwagger2Spec(filepath string) (Specification, error)

ReadSwagger2Spec returns a Swagger Specification from a filepath.

Jump to

Keyboard shortcuts

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