Documentation ¶
Index ¶
- Constants
- Variables
- type Contact
- type DataTypeDesc
- type Definitions
- type ExternalDocs
- type Generator
- type Header
- type Headers
- type Info
- type License
- type Operation
- type Parameter
- type Path
- type Paths
- type Properties
- type Response
- type Responses
- type Schema
- type SchemaDef
- type StringOrArray
- type Swagger
- type Version20
Constants ¶
View Source
const ( TypeInteger = "integer" TypeNumber = "number" TypeString = "string" TypeBoolean = "boolean" TypeArray = "array" TypeObject = "object" FormatNone = "" FormatInt32 = "int32" FormatInt64 = "int64" FormatFloat = "float" FormatDouble = "double" FormatByte = "byte" FormatBinary = "binary" FormatDate = "date" FormatDateTime = "date-time" FormatPassword = "password" )
Variables ¶
View Source
var ( IntegerType = DataTypeDesc{Type: TypeInteger, Format: FormatInt32} LongType = DataTypeDesc{Type: TypeInteger, Format: FormatInt64} Uint64Type = DataTypeDesc{Type: TypeString, Format: "uint64"} // non-standart type FloatType = DataTypeDesc{Type: TypeNumber, Format: FormatFloat} DoubleType = DataTypeDesc{Type: TypeNumber, Format: FormatDouble} StringType = DataTypeDesc{Type: TypeString, Format: FormatNone} ByteType = DataTypeDesc{Type: TypeString, Format: FormatByte} BinaryType = DataTypeDesc{Type: TypeString, Format: FormatBinary} BooleanType = DataTypeDesc{Type: TypeBoolean, Format: FormatNone} DateType = DataTypeDesc{Type: TypeString, Format: FormatDate} DateTimeType = DataTypeDesc{Type: TypeString, Format: FormatDateTime} PasswordType = DataTypeDesc{Type: TypeString, Format: FormatPassword} )
Datatypes from https://swagger.io/specification/v2/
Functions ¶
This section is empty.
Types ¶
type DataTypeDesc ¶
func (DataTypeDesc) Schema ¶
func (d DataTypeDesc) Schema() *Schema
type Definitions ¶
func (Definitions) MarshalJSON ¶
func (d Definitions) MarshalJSON() ([]byte, error)
type ExternalDocs ¶
type Headers ¶
func (Headers) MarshalJSON ¶
type Operation ¶
type Operation struct { OperationID string `json:"operationId,omitempty"` Summary string `json:"summary,omitempty"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Parameters []Parameter `json:"parameters,omitempty"` Responses Responses `json:"responses"` ExternalDocs *ExternalDocs `json:"externalDocs,omitempty"` }
type Paths ¶
func (Paths) MarshalJSON ¶
type Properties ¶
func (Properties) MarshalJSON ¶
func (p Properties) MarshalJSON() ([]byte, error)
type Responses ¶
func (Responses) MarshalJSON ¶
type Schema ¶
func (*Schema) MarshalJSON ¶
type SchemaDef ¶
type SchemaDef struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Type StringOrArray `json:"type"` Format string `json:"format,omitempty"` Required []string `json:"required,omitempty"` Default interface{} `json:"default,omitempty"` Minimum *float64 `json:"minimum,omitempty"` Maximum *float64 `json:"maximum,omitempty"` MultipleOf *float64 `json:"multipleOf,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` MaxItems *int64 `json:"maxItems,omitempty"` MinItems *int64 `json:"minItems,omitempty"` Properties Properties `json:"properties,omitempty"` AdditionalProperties *Schema `json:"additionalProperties,omitempty"` Items *Schema `json:"items,omitempty"` Enum []string `json:"enum,omitempty"` AllOf []*Schema `json:"allOf,omitempty"` }
type StringOrArray ¶
type StringOrArray []string
func (StringOrArray) MarshalJSON ¶
func (s StringOrArray) MarshalJSON() ([]byte, error)
type Swagger ¶
type Swagger struct { Swagger Version20 `json:"swagger"` Info Info `json:"info"` Host string `json:"host,omitempty"` BasePath string `json:"basePath"` Schemes []string `json:"schemes,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Paths Paths `json:"paths"` Definitions Definitions `json:"definitions,omitempty"` }
Click to show internal directories.
Click to hide internal directories.