types

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParameterInQuery    = "query"
	ParameterInFormData = "formData"
	ParameterInHeader   = "header"
)

ParameterIn 参数来源

View Source
const (
	SchemaTypeString  = "string"
	SchemaTypeInteger = "integer"
	SchemaTypeNumber  = "number"
	SchemaTypeBoolean = "boolean"
	SchemaTypeFile    = "file"
	SchemaTypeObject  = "object"
	SchemaTypeArray   = "array"
)

SchemaType 概要类型

Variables

This section is empty.

Functions

func CombineProperties

func CombineProperties(m, m2 map[string]*Schema) map[string]*Schema

Types

type Definition

type Definition struct {
	Type                 string             `json:"type"`
	Required             []string           `json:"required"`
	Properties           map[string]*Schema `json:"properties"`
	AdditionalProperties *Schema            `json:"additionalProperties"`
}

Definition 定义详情

type Info

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

Info 项目详情

type Operation

type Operation struct {
	Consumes   []string              `json:"consumes"`
	Produces   []string              `json:"produces"`
	Tags       []string              `json:"tags"`
	Summary    string                `json:"summary"`
	Security   []map[string][]string `json:"security"`
	Parameters []*Parameter          `json:"parameters"`
	Responses  map[int]*Response     `json:"responses"`
}

Operation 操作详情

type Parameter

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

Parameter 参数详情

type PathInfo

type PathInfo struct {
	Tag        string
	Method     string
	Path       string
	Summary    string
	NeedAuth   bool
	Consume    string
	Produce    string
	Parameters []*Parameter
	Responses  map[int]*Response
}

PathInfo 路径详情

type Property

type Property struct {
	Name   string
	Schema *Schema
}

Property 属性字段详情

type PropertySorter

type PropertySorter []*Property

PropertySorter 属性字段排序器

func NewPropertySorter

func NewPropertySorter(m map[string]*Schema) PropertySorter

NewPropertySorter 新建属性字段排序器

func (PropertySorter) Len

func (ps PropertySorter) Len() int

Len 实现 Len 方法

func (PropertySorter) Less

func (ps PropertySorter) Less(i, j int) bool

Less 实现 Less 方法

func (PropertySorter) Swap

func (ps PropertySorter) Swap(i, j int)

Swap 实现 Swap 方法

type Response

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

Response 响应详情

type Schema

type Schema struct {
	Ref                  string             `json:"$ref"`
	Description          string             `json:"description"`
	Type                 string             `json:"type"`
	XOrder               string             `json:"x-order"`
	Properties           map[string]*Schema `json:"properties"`
	AllOf                []*Schema          `json:"allOf"`
	Items                *Schema            `json:"items"`
	Example              interface{}        `json:"example"`
	AdditionalProperties *Schema            `json:"additionalProperties"`
}

Schema 概要详情

type Swagger

type Swagger struct {
	BasePath    string                           `json:"basePath"`
	Info        *Info                            `json:"info"`
	Paths       map[string]map[string]*Operation `json:"paths"`
	Definitions map[string]*Definition           `json:"definitions"`
}

Swagger swagger详情

Jump to

Keyboard shortcuts

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