Documentation ¶
Index ¶
- Constants
- func SwaggerValidator(api *swagger.API) gin.HandlerFunc
- func SwaggerValidatorEcho(api *swagger.API) echo.MiddlewareFunc
- type CustomLocale
- func (l CustomLocale) AdditionalPropertyNotAllowed() string
- func (l CustomLocale) ArrayContains() string
- func (l CustomLocale) ArrayMaxItems() string
- func (l CustomLocale) ArrayMaxProperties() string
- func (l CustomLocale) ArrayMinItems() string
- func (l CustomLocale) ArrayMinProperties() string
- func (l CustomLocale) ArrayNoAdditionalItems() string
- func (l CustomLocale) ArrayNotEnoughItems() string
- func (l CustomLocale) CannotBeGT() string
- func (l CustomLocale) CannotBeUsedWithout() string
- func (l CustomLocale) ConditionElse() string
- func (l CustomLocale) ConditionThen() string
- func (l CustomLocale) Const() string
- func (l CustomLocale) DoesNotMatchFormat() string
- func (l CustomLocale) DoesNotMatchPattern() string
- func (l CustomLocale) Duplicated() string
- func (l CustomLocale) Enum() string
- func (l CustomLocale) ErrorFormat() string
- func (l CustomLocale) False() string
- func (l CustomLocale) GreaterThanZero() string
- func (l CustomLocale) HttpBadStatus() string
- func (l CustomLocale) Internal() string
- func (l CustomLocale) InvalidPropertyName() string
- func (l CustomLocale) InvalidPropertyPattern() string
- func (l CustomLocale) InvalidType() string
- func (l CustomLocale) KeyCannotBeGreaterThan() string
- func (l CustomLocale) KeyItemsMustBeOfType() string
- func (l CustomLocale) KeyItemsMustBeUnique() string
- func (l CustomLocale) MissingDependency() string
- func (l CustomLocale) MultipleOf() string
- func (l CustomLocale) MustBeGTEZero() string
- func (l CustomLocale) MustBeOfA() string
- func (l CustomLocale) MustBeOfAn() string
- func (l CustomLocale) MustBeOfType() string
- func (l CustomLocale) MustBeValidFormat() string
- func (l CustomLocale) MustBeValidRegex() string
- func (l CustomLocale) NotAValidType() string
- func (l CustomLocale) NumberAllOf() string
- func (l CustomLocale) NumberAnyOf() string
- func (l CustomLocale) NumberGT() string
- func (l CustomLocale) NumberGTE() string
- func (l CustomLocale) NumberLT() string
- func (l CustomLocale) NumberLTE() string
- func (l CustomLocale) NumberNot() string
- func (l CustomLocale) NumberOneOf() string
- func (l CustomLocale) ParseError() string
- func (l CustomLocale) ReferenceMustBeCanonical() string
- func (l CustomLocale) RegexPattern() string
- func (l CustomLocale) Required() string
- func (l CustomLocale) StringGTE() string
- func (l CustomLocale) StringLTE() string
- func (l CustomLocale) Unique() string
- type RequestParameter
- type RequestSchema
- type SchemaDefinition
- type SchemaProperty
Constants ¶
const MaxMemory = 1 * 1024 * 1024
MaxMemory ...
Variables ¶
This section is empty.
Functions ¶
func SwaggerValidator ¶
func SwaggerValidator(api *swagger.API) gin.HandlerFunc
SwaggerValidator Gin middleware
func SwaggerValidatorEcho ¶
SwaggerValidatorEcho middleware
Types ¶
type CustomLocale ¶
type CustomLocale struct{}
CustomLocale is a locale for schema validator
func (CustomLocale) AdditionalPropertyNotAllowed ¶
func (l CustomLocale) AdditionalPropertyNotAllowed() string
AdditionalPropertyNotAllowed ...
func (CustomLocale) ArrayMaxProperties ¶
func (l CustomLocale) ArrayMaxProperties() string
ArrayMaxProperties ...
func (CustomLocale) ArrayMinProperties ¶
func (l CustomLocale) ArrayMinProperties() string
ArrayMinProperties ...
func (CustomLocale) ArrayNoAdditionalItems ¶
func (l CustomLocale) ArrayNoAdditionalItems() string
ArrayNoAdditionalItems ...
func (CustomLocale) ArrayNotEnoughItems ¶
func (l CustomLocale) ArrayNotEnoughItems() string
ArrayNotEnoughItems ...
func (CustomLocale) CannotBeUsedWithout ¶
func (l CustomLocale) CannotBeUsedWithout() string
CannotBeUsedWithout ...
func (CustomLocale) DoesNotMatchFormat ¶
func (l CustomLocale) DoesNotMatchFormat() string
DoesNotMatchFormat ...
func (CustomLocale) DoesNotMatchPattern ¶
func (l CustomLocale) DoesNotMatchPattern() string
DoesNotMatchPattern ...
func (CustomLocale) False ¶
func (l CustomLocale) False() string
False returns a format-string for "false" schema validation errors
func (CustomLocale) GreaterThanZero ¶
func (l CustomLocale) GreaterThanZero() string
GreaterThanZero ...
func (CustomLocale) InvalidPropertyName ¶
func (l CustomLocale) InvalidPropertyName() string
InvalidPropertyName ...
func (CustomLocale) InvalidPropertyPattern ¶
func (l CustomLocale) InvalidPropertyPattern() string
InvalidPropertyPattern ...
func (CustomLocale) KeyCannotBeGreaterThan ¶
func (l CustomLocale) KeyCannotBeGreaterThan() string
KeyCannotBeGreaterThan ...
func (CustomLocale) KeyItemsMustBeOfType ¶
func (l CustomLocale) KeyItemsMustBeOfType() string
KeyItemsMustBeOfType ...
func (CustomLocale) KeyItemsMustBeUnique ¶
func (l CustomLocale) KeyItemsMustBeUnique() string
KeyItemsMustBeUnique ...
func (CustomLocale) MissingDependency ¶
func (l CustomLocale) MissingDependency() string
MissingDependency ...
func (CustomLocale) MustBeValidFormat ¶
func (l CustomLocale) MustBeValidFormat() string
MustBeValidFormat ...
func (CustomLocale) MustBeValidRegex ¶
func (l CustomLocale) MustBeValidRegex() string
MustBeValidRegex ...
func (CustomLocale) ReferenceMustBeCanonical ¶
func (l CustomLocale) ReferenceMustBeCanonical() string
ReferenceMustBeCanonical ...
func (CustomLocale) Required ¶
func (l CustomLocale) Required() string
Required returns a format-string for "required" schema validation errors
type RequestParameter ¶
type RequestParameter struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Format string `json:"format,omitempty"` Items *swagger.Items `json:"items,omitempty"` Nullable bool `json:"nullable,omitempty"` Enum []string `json:"enum,omitempty"` Pattern string `json:"pattern,omitempty"` MinItems int `json:"minItems,omitempty"` MaxItems int `json:"maxItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MaxLength int `json:"maxLength,omitempty"` MinLength int `json:"minLength,omitempty"` Minimum *int64 `json:"minimum,omitempty"` Maximum *int64 `json:"maximum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` AdditionalProperties interface{} `json:"additionalProperties,omitempty"` }
RequestParameter ...
type RequestSchema ¶
type RequestSchema struct { Title string `json:"title"` Type string `json:"type"` Summary string `json:"summary"` Properties map[string]interface{} `json:"properties"` Required []string `json:"required"` Definitions map[string]SchemaDefinition `json:"definitions"` AdditionalProperties bool `json:"additionalProperties"` }
RequestSchema ...
type SchemaDefinition ¶
type SchemaDefinition struct { Name string `json:"-"` Type string `json:"type"` Format string `json:"format,omitempty"` Required []string `json:"required,omitempty"` Properties map[string]SchemaProperty `json:"properties,omitempty"` Enum []string `json:"enum,omitempty"` Pattern string `json:"pattern,omitempty"` MinItems int `json:"minItems,omitempty"` MaxItems int `json:"maxItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` Minimum *int64 `json:"minimum,omitempty"` Maximum *int64 `json:"maximum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` AdditionalProperties bool `json:"additionalProperties"` }
SchemaDefinition ...
type SchemaProperty ¶
type SchemaProperty struct { Type []string `json:"type,omitempty"` Description string `json:"description,omitempty"` Enum []string `json:"enum,omitempty"` Format string `json:"format,omitempty"` Ref string `json:"$ref,omitempty"` Example string `json:"example,omitempty"` Items *swagger.Items `json:"items,omitempty"` Pattern string `json:"pattern,omitempty"` MinItems int `json:"minItems,omitempty"` MaxItems int `json:"maxItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` Minimum *int64 `json:"minimum,omitempty"` Maximum *int64 `json:"maximum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` AdditionalProperties interface{} `json:"additionalProperties,omitempty"` }
SchemaProperty ...