swaggergen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeObject  = Type("object")
	TypeArray   = Type("array")
	TypeBoolean = Type("boolean")
	TypeInteger = Type("integer")
	TypeNumber  = Type("number")
	TypeString  = Type("string")
)

Type :

Variables

This section is empty.

Functions

func New

func New(build *buildcontext.Context, program *loader.Program) output.Command

New :

Types

type Enum

type Enum struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Value       string `json:"value"`

	XGoName string    `json:"x-goname"`
	Pos     token.Pos `json:"-"` // id
}

Enum :

type Schema

type Schema struct {
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Type        Type             `json:"type"`
	Properties  []SchemaProperty `json:"properties,omitempty"`
	Required    []string         `json:"required,omitempty"`

	XGoName string `json:"x-goname"`
	XGoType string `json:"x-gotype"`

	Enum []Enum    `json:"enum,omitempty"` //
	Pos  token.Pos `json:"-"`              // id
}

Schema :

func ParsePackageInfo

func ParsePackageInfo(info *loader.PackageInfo, findDescription bool) ([]*Schema, error)

ParsePackageInfo :

func ParseStruct

func ParseStruct(info *loader.PackageInfo, sorted bypos.Sorted, ob types.Object, findDescription bool) *Schema

ParseStruct :

type SchemaProperty

type SchemaProperty struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Type        Type   `json:"type"`
	Required    bool   `json:"required"`

	XGoName string `json:"x-goname"`
	XGoType string `json:"x-gotype"`

	Depends []token.Pos `json:"-"`
}

SchemaProperty :

type Type

type Type string

Type :

func ParseType

func ParseType(ob types.Object) Type

ParseType :

Jump to

Keyboard shortcuts

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