Documentation ¶
Index ¶
- Constants
- func FlattenMarshalJSON(values ...interface{}) ([]byte, error)
- func FlattenUnmarshalJSON(data []byte, values ...interface{}) error
- type Discriminator
- type ExternalDoc
- type OpenAPISchemaFormatGetter
- type OpenAPISchemaTypeGetter
- type Props
- type Ref
- type Refer
- type Reference
- type Schema
- func AllOf(schemas ...*Schema) *Schema
- func AnyOf(schemas ...*Schema) *Schema
- func Binary() *Schema
- func Boolean() *Schema
- func Bytes() *Schema
- func Double() *Schema
- func Float() *Schema
- func Integer() *Schema
- func ItemsOf(items *Schema) *Schema
- func KeyValueOf(k *Schema, s *Schema) *Schema
- func Long() *Schema
- func MapOf(s *Schema) *Schema
- func NewSchema(tpe string, fmt ...string) *Schema
- func Not(schema *Schema) *Schema
- func ObjectOf(props Props, required ...string) *Schema
- func OneOf(schemas ...*Schema) *Schema
- func RefSchema(ref string) *Schema
- func RefSchemaByRefer(refer Refer) *Schema
- func String() *Schema
- func (s Schema) MarshalJSON() ([]byte, error)
- func (s *Schema) SetProperty(name string, propSchema *Schema, required bool)
- func (s *Schema) UnmarshalJSON(data []byte) error
- func (s Schema) WithDesc(desc string) *Schema
- func (s Schema) WithDiscriminator(discriminator *Discriminator) *Schema
- func (s Schema) WithTitle(title string) *Schema
- func (s Schema) WithValidation(validation *SchemaValidation) *Schema
- type SchemaBasic
- type SchemaOrArray
- type SchemaOrBool
- type SchemaValidation
- type StringOrArray
- type VendorExtensible
- type XML
Constants ¶
View Source
const ( XEnumLabels = `x-enum-labels` XGoVendorType = `x-go-vendor-type` XGoStarLevel = `x-go-star-level` XGoFieldName = `x-go-field-name` XTagValidate = `x-tag-validate` )
View Source
const ( TypeInteger = "integer" TypeNumber = "number" TypeString = "string" TypeBoolean = "boolean" TypeArray = "array" TypeObject = "object" )
Variables ¶
This section is empty.
Functions ¶
func FlattenMarshalJSON ¶
func FlattenUnmarshalJSON ¶
Types ¶
type Discriminator ¶
type ExternalDoc ¶
type ExternalDoc struct { Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` }
func NewExternalDoc ¶
func NewExternalDoc(url string, desc string) *ExternalDoc
type OpenAPISchemaFormatGetter ¶
type OpenAPISchemaFormatGetter interface {
OpenAPISchemaFormat() string
}
type OpenAPISchemaTypeGetter ¶
type OpenAPISchemaTypeGetter interface {
OpenAPISchemaType() []string
}
type Reference ¶
type Reference struct {
Refer
}
func (Reference) MarshalJSONRefFirst ¶
func (*Reference) UnmarshalJSONRefFirst ¶
type Schema ¶
type Schema struct { SchemaBasic Reference VendorExtensible }
func KeyValueOf ¶
func RefSchemaByRefer ¶
func (Schema) MarshalJSON ¶
func (*Schema) SetProperty ¶
func (*Schema) UnmarshalJSON ¶
func (Schema) WithDiscriminator ¶
func (s Schema) WithDiscriminator(discriminator *Discriminator) *Schema
func (Schema) WithValidation ¶
func (s Schema) WithValidation(validation *SchemaValidation) *Schema
type SchemaBasic ¶
type SchemaBasic struct { Type StringOrArray `json:"type,omitempty"` Format string `json:"format,omitempty"` Items *SchemaOrArray `json:"items,omitempty"` Properties map[string]*Schema `json:"properties,omitempty"` AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` PropertyNames *Schema `json:"propertyNames,omitempty"` AllOf []*Schema `json:"allOf,omitempty"` AnyOf []*Schema `json:"anyOf,omitempty"` OneOf []*Schema `json:"oneOf,omitempty"` Not *Schema `json:"not,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Default interface{} `json:"default,omitempty"` Nullable bool `json:"nullable,omitempty"` Discriminator *Discriminator `json:"discriminator,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` WriteOnly bool `json:"writeOnly,omitempty"` XML *XML `json:"xml,omitempty"` ExternalDocs *ExternalDoc `json:"external_docs,omitempty"` Example interface{} `json:"example,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Definitions map[string]*Schema `json:"definitions,omitempty"` SchemaValidation }
type SchemaOrArray ¶
func (SchemaOrArray) Len ¶
func (s SchemaOrArray) Len() int
func (*SchemaOrArray) MarshalJSON ¶
func (s *SchemaOrArray) MarshalJSON() ([]byte, error)
func (*SchemaOrArray) UnmarshalJSON ¶
func (s *SchemaOrArray) UnmarshalJSON(data []byte) error
type SchemaOrBool ¶
func (*SchemaOrBool) MarshalJSON ¶
func (s *SchemaOrBool) MarshalJSON() ([]byte, error)
func (*SchemaOrBool) UnmarshalJSON ¶
func (s *SchemaOrBool) UnmarshalJSON(data []byte) error
type SchemaValidation ¶
type SchemaValidation struct { // numbers MultipleOf *float64 `json:"multipleOf,omitempty"` Maximum *float64 `json:"maximum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` Minimum *float64 `json:"minimum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` // string MaxLength *uint64 `json:"maxLength,omitempty"` MinLength *uint64 `json:"minLength,omitempty"` Pattern string `json:"pattern,omitempty"` // array MaxItems *uint64 `json:"maxItems,omitempty"` MinItems *uint64 `json:"minItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` // object MaxProperties *uint64 `json:"maxProperties,omitempty"` MinProperties *uint64 `json:"minProperties,omitempty"` Required []string `json:"required,omitempty"` // any Enum []interface{} `json:"enum,omitempty"` }
type StringOrArray ¶
type StringOrArray []string
func (StringOrArray) Contains ¶
func (s StringOrArray) Contains(value string) bool
func (StringOrArray) MarshalJSON ¶
func (s StringOrArray) MarshalJSON() ([]byte, error)
func (*StringOrArray) UnmarshalJSON ¶
func (s *StringOrArray) UnmarshalJSON(data []byte) error
type VendorExtensible ¶
type VendorExtensible struct {
Extensions map[string]interface{}
}
func (*VendorExtensible) AddExtension ¶
func (v *VendorExtensible) AddExtension(key string, value interface{})
func (VendorExtensible) MarshalJSON ¶
func (v VendorExtensible) MarshalJSON() ([]byte, error)
func (*VendorExtensible) UnmarshalJSON ¶
func (v *VendorExtensible) UnmarshalJSON(data []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.