gen

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(swag *model.Swagger, w io.Writer) error

Generate uses swag to generate a npm tgz file into w

func LoadSwagger

func LoadSwagger(pkgConf model.PackageInfo, spec *Spec) (s *model.Swagger, err error)

func MakeIndex

func MakeIndex(swag *model.Swagger, w io.Writer) error

Types

type Spec

type Spec struct {
	FileType model.SwaggerFileType
	Raw      []byte              // swagger source file
	Info     model.SwaggerInfo   `json:"info" yaml:"info"`
	Paths    map[string]SpecPath `json:"paths" yaml:"paths"` // the key is path
}

func LoadSpec

func LoadSpec(reader io.Reader, t model.SwaggerFileType) (spec *Spec, err error)

type SpecParameter

type SpecParameter struct {
	In   string `json:"in" yaml:"in"`
	Name string `json:"name" yaml:"name"`
	Desc string `json:"description" yaml:"description"`
	Ref  string `json:"$ref" yaml:"$ref"` // ref to def, not supported yet
}

type SpecPath

type SpecPath map[string]struct {
	Description string          `json:"description" yaml:"description"`
	Summary     string          `json:"summary" yaml:"summary"`
	OperationId string          `json:"operationId" yaml:"operationId"`
	Tags        []string        `json:"tags" yaml:"tags"`
	Parameters  []SpecParameter `json:"parameters" yaml:"parameters"`

} // key is method

Jump to

Keyboard shortcuts

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