Versions in this module Expand all Collapse all v0 v0.2.0 Dec 25, 2015 Changes in this version type Document + func (d *Document) Pristine() *Document v0.1.0 Dec 14, 2015 Changes in this version + const JSONSchemaURL + const SwaggerSchemaURL + func Asset(name string) ([]byte, error) + func AssetDir(name string) ([]string, error) + func AssetInfo(name string) (os.FileInfo, error) + func AssetNames() []string + func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error + func MustAsset(name string) []byte + func RestoreAsset(dir, name string) error + func RestoreAssets(dir, name string) error + type ContactInfo struct + Email string + Name string + URL string + type Definitions map[string]Schema + type Dependencies map[string]SchemaOrStringArray + type DocLoader func(string) (json.RawMessage, error) + type Document struct + func JSONSpec(path string) (*Document, error) + func Load(path string) (*Document, error) + func New(data json.RawMessage, version string) (*Document, error) + func YAMLSpec(path string) (*Document, error) + func (d *Document) BasePath() string + func (d *Document) Expanded() (*Document, error) + func (d *Document) Host() string + func (d *Document) Raw() json.RawMessage + func (d *Document) Reload() *Document + func (d *Document) Schema() *Schema + func (d *Document) Spec() *Swagger + func (d *Document) Version() string + func (s *Document) AllDefinitions() (result []SchemaRef) + func (s *Document) AllPaths() map[string]PathItem + func (s *Document) ConsumesFor(operation *Operation) []string + func (s *Document) OperationFor(method, path string) (*Operation, bool) + func (s *Document) OperationForName(operationID string) (string, string, *Operation, bool) + func (s *Document) OperationIDs() []string + func (s *Document) Operations() map[string]map[string]*Operation + func (s *Document) ParametersFor(operationID string) []Parameter + func (s *Document) ParamsFor(method, path string) map[string]Parameter + func (s *Document) ProducesFor(operation *Operation) []string + func (s *Document) RequiredConsumes() []string + func (s *Document) RequiredProduces() []string + func (s *Document) RequiredSecuritySchemes() []string + func (s *Document) SchemasWithAllOf() (result []SchemaRef) + func (s *Document) SecurityDefinitionsFor(operation *Operation) map[string]SecurityScheme + func (s *Document) SecurityRequirementsFor(operation *Operation) []SecurityRequirement + type Extensions map[string]interface + func (e Extensions) Add(key string, value interface{}) + func (e Extensions) GetString(key string) (string, bool) + type ExternalDocumentation struct + Description string + URL string + type Header struct + func (h *Header) CollectionOf(items *Items, format string) *Header + func (h *Header) Typed(tpe, format string) *Header + func (h *Header) UnmarshalJSON(data []byte) error + func (h Header) MarshalJSON() ([]byte, error) + func (s *Header) ItemsTypeName() string + func (s *Header) TypeName() string + type Info struct + func (i *Info) UnmarshalJSON(data []byte) error + func (i Info) JSONLookup(token string) (interface{}, error) + func (i Info) MarshalJSON() ([]byte, error) + func (v *Info) AddExtension(key string, value interface{}) + type Items struct + func NewItems() *Items + func (i *Items) AllowDuplicates() *Items + func (i *Items) CollectionOf(items *Items, format string) *Items + func (i *Items) Typed(tpe, format string) *Items + func (i *Items) UniqueValues() *Items + func (i *Items) UnmarshalJSON(data []byte) error + func (i *Items) WithDefault(defaultValue interface{}) *Items + func (i *Items) WithEnum(values ...interface{}) *Items + func (i *Items) WithMaxItems(size int64) *Items + func (i *Items) WithMaxLength(max int64) *Items + func (i *Items) WithMaximum(max float64, exclusive bool) *Items + func (i *Items) WithMinItems(size int64) *Items + func (i *Items) WithMinLength(min int64) *Items + func (i *Items) WithMinimum(min float64, exclusive bool) *Items + func (i *Items) WithMultipleOf(number float64) *Items + func (i *Items) WithPattern(pattern string) *Items + func (i Items) MarshalJSON() ([]byte, error) + func (s *Items) ItemsTypeName() string + func (s *Items) TypeName() string + type License struct + Name string + URL string + type Operation struct + func (o *Operation) SuccessResponse() (*Response, int, bool) + func (o *Operation) UnmarshalJSON(data []byte) error + func (o Operation) JSONLookup(token string) (interface{}, error) + func (o Operation) MarshalJSON() ([]byte, error) + func (v *Operation) AddExtension(key string, value interface{}) + type Parameter struct + func BodyParam(name string, schema *Schema) *Parameter + func FileParam(name string) *Parameter + func FormDataParam(name string) *Parameter + func HeaderParam(name string) *Parameter + func PathParam(name string) *Parameter + func QueryParam(name string) *Parameter + func SimpleArrayParam(name, tpe, fmt string) *Parameter + func (p *Parameter) AllowDuplicates() *Parameter + func (p *Parameter) AsOptional() *Parameter + func (p *Parameter) AsRequired() *Parameter + func (p *Parameter) CollectionOf(items *Items, format string) *Parameter + func (p *Parameter) Typed(tpe, format string) *Parameter + func (p *Parameter) UniqueValues() *Parameter + func (p *Parameter) UnmarshalJSON(data []byte) error + func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter + func (p *Parameter) WithEnum(values ...interface{}) *Parameter + func (p *Parameter) WithMaxItems(size int64) *Parameter + func (p *Parameter) WithMaxLength(max int64) *Parameter + func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter + func (p *Parameter) WithMinItems(size int64) *Parameter + func (p *Parameter) WithMinLength(min int64) *Parameter + func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter + func (p *Parameter) WithMultipleOf(number float64) *Parameter + func (p *Parameter) WithPattern(pattern string) *Parameter + func (p Parameter) JSONLookup(token string) (interface{}, error) + func (p Parameter) MarshalJSON() ([]byte, error) + func (s *Parameter) ItemsTypeName() string + func (s *Parameter) TypeName() string + func (v *Parameter) AddExtension(key string, value interface{}) + type PathItem struct + func (p *PathItem) UnmarshalJSON(data []byte) error + func (p PathItem) JSONLookup(token string) (interface{}, error) + func (p PathItem) MarshalJSON() ([]byte, error) + func (v *PathItem) AddExtension(key string, value interface{}) + type Paths struct + Paths map[string]PathItem + func (p *Paths) UnmarshalJSON(data []byte) error + func (p Paths) JSONLookup(token string) (interface{}, error) + func (p Paths) MarshalJSON() ([]byte, error) + func (v *Paths) AddExtension(key string, value interface{}) + type Ref struct + func MustCreateRef(refURI string) Ref + func NewRef(refURI string) (Ref, error) + func (r *Ref) Inherits(child Ref) (*Ref, error) + func (r *Ref) UnmarshalJSON(d []byte) error + func (r Ref) MarshalJSON() ([]byte, error) + type ResolutionCache interface + Get func(string) (interface{}, bool) + Set func(string, interface{}) + type Response struct + func (r *Response) UnmarshalJSON(data []byte) error + func (r Response) MarshalJSON() ([]byte, error) + type Responses struct + func (r *Responses) UnmarshalJSON(data []byte) error + func (r Responses) JSONLookup(token string) (interface{}, error) + func (r Responses) MarshalJSON() ([]byte, error) + func (v *Responses) AddExtension(key string, value interface{}) + type Schema struct + ExtraProps map[string]interface{} + func ArrayProperty(items *Schema) *Schema + func BoolProperty() *Schema + func BooleanProperty() *Schema + func CharProperty() *Schema + func DateProperty() *Schema + func DateTimeProperty() *Schema + func Float32Property() *Schema + func Float64Property() *Schema + func Int16Property() *Schema + func Int32Property() *Schema + func Int64Property() *Schema + func Int8Property() *Schema + func JSONSchemaDraft04() (*Schema, error) + func MapProperty(property *Schema) *Schema + func MustLoadJSONSchemaDraft04() *Schema + func MustLoadSwagger20Schema() *Schema + func RefProperty(name string) *Schema + func ResolveRef(root interface{}, ref *Ref) (*Schema, error) + func StrFmtProperty(format string) *Schema + func StringProperty() *Schema + func Swagger20Schema() (*Schema, error) + func (s *Schema) AddType(tpe, format string) *Schema + func (s *Schema) AllowDuplicates() *Schema + func (s *Schema) CollectionOf(items Schema) *Schema + func (s *Schema) SetProperty(name string, schema Schema) *Schema + func (s *Schema) Typed(tpe, format string) *Schema + func (s *Schema) UniqueValues() *Schema + func (s *Schema) UnmarshalJSON(data []byte) error + func (s *Schema) WithAllOf(schemas ...Schema) *Schema + func (s *Schema) WithDefault(defaultValue interface{}) *Schema + func (s *Schema) WithEnum(values ...interface{}) *Schema + func (s *Schema) WithMaxItems(size int64) *Schema + func (s *Schema) WithMaxLength(max int64) *Schema + func (s *Schema) WithMaxProperties(max int64) *Schema + func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema + func (s *Schema) WithMinItems(size int64) *Schema + func (s *Schema) WithMinLength(min int64) *Schema + func (s *Schema) WithMinProperties(min int64) *Schema + func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema + func (s *Schema) WithMultipleOf(number float64) *Schema + func (s *Schema) WithPattern(pattern string) *Schema + func (s *Schema) WithProperties(schemas map[string]Schema) *Schema + func (s *Schema) WithRequired(items ...string) *Schema + func (s Schema) JSONLookup(token string) (interface{}, error) + func (s Schema) MarshalJSON() ([]byte, error) + func (v *Schema) AddExtension(key string, value interface{}) + type SchemaOrArray struct + Schema *Schema + Schemas []Schema + func (s *SchemaOrArray) ContainsType(name string) bool + func (s *SchemaOrArray) UnmarshalJSON(data []byte) error + func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) + func (s SchemaOrArray) Len() int + func (s SchemaOrArray) MarshalJSON() ([]byte, error) + type SchemaOrBool struct + Allows bool + Schema *Schema + func (s *SchemaOrBool) UnmarshalJSON(data []byte) error + func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) + func (s SchemaOrBool) MarshalJSON() ([]byte, error) + type SchemaOrStringArray struct + Property []string + Schema *Schema + func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error + func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) + func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) + type SchemaRef struct + Name string + Ref Ref + Schema *Schema + type SchemaURL string + func (r *SchemaURL) UnmarshalJSON(data []byte) error + func (r SchemaURL) MarshalJSON() ([]byte, error) + type SecurityDefinitions map[string]*SecurityScheme + type SecurityRequirement struct + Name string + Scopes []string + type SecurityScheme struct + func APIKeyAuth(fieldName, valueSource string) *SecurityScheme + func BasicAuth() *SecurityScheme + func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme + func OAuth2Application(tokenURL string) *SecurityScheme + func OAuth2Implicit(authorizationURL string) *SecurityScheme + func OAuth2Password(tokenURL string) *SecurityScheme + func (s *SecurityScheme) AddScope(scope, description string) + func (s *SecurityScheme) UnmarshalJSON(data []byte) error + func (s SecurityScheme) JSONLookup(token string) (interface{}, error) + func (s SecurityScheme) MarshalJSON() ([]byte, error) + func (v *SecurityScheme) AddExtension(key string, value interface{}) + type StringOrArray []string + func (s *StringOrArray) UnmarshalJSON(data []byte) error + func (s StringOrArray) Contains(value string) bool + func (s StringOrArray) MarshalJSON() ([]byte, error) + type Swagger struct + func (s *Swagger) UnmarshalJSON(data []byte) error + func (s Swagger) MarshalJSON() ([]byte, error) + type Tag struct + func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag + func (t *Tag) UnmarshalJSON(data []byte) error + func (t Tag) JSONLookup(token string) (interface{}, error) + func (t Tag) MarshalJSON() ([]byte, error) + func (v *Tag) AddExtension(key string, value interface{}) + type XMLObject struct + Attribute bool + Name string + Namespace string + Prefix string + Wrapped bool