Back to godoc.org
github.com/Rekfuki/swag-validator

Package swagvalidator

v0.0.0-...-0845721
Latest Go to latest

The latest major version is .

Published: Oct 31, 2019 | License: Apache-2.0 | Module: github.com/Rekfuki/swag-validator

Index

Constants

const MaxMemory = 1 * 1024 * 1024

MaxMemory ...

func SwaggerValidator

func SwaggerValidator(api *swagger.API) gin.HandlerFunc

SwaggerValidator Gin middleware

func SwaggerValidatorEcho

func SwaggerValidatorEcho(api *swagger.API) echo.MiddlewareFunc

SwaggerValidatorEcho middleware

type CustomLocale

type CustomLocale struct{}

CustomLocale is a locale for schema validator

func (CustomLocale) AdditionalPropertyNotAllowed

func (l CustomLocale) AdditionalPropertyNotAllowed() string

AdditionalPropertyNotAllowed ...

func (CustomLocale) ArrayContains

func (l CustomLocale) ArrayContains() string

ArrayContains ...

func (CustomLocale) ArrayMaxItems

func (l CustomLocale) ArrayMaxItems() string

ArrayMaxItems ...

func (CustomLocale) ArrayMaxProperties

func (l CustomLocale) ArrayMaxProperties() string

ArrayMaxProperties ...

func (CustomLocale) ArrayMinItems

func (l CustomLocale) ArrayMinItems() string

ArrayMinItems ...

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) CannotBeGT

func (l CustomLocale) CannotBeGT() string

CannotBeGT ...

func (CustomLocale) CannotBeUsedWithout

func (l CustomLocale) CannotBeUsedWithout() string

CannotBeUsedWithout ...

func (CustomLocale) ConditionElse

func (l CustomLocale) ConditionElse() string

ConditionElse ...

func (CustomLocale) ConditionThen

func (l CustomLocale) ConditionThen() string

ConditionThen ...

func (CustomLocale) Const

func (l CustomLocale) Const() string

Const ...

func (CustomLocale) DoesNotMatchFormat

func (l CustomLocale) DoesNotMatchFormat() string

DoesNotMatchFormat ...

func (CustomLocale) DoesNotMatchPattern

func (l CustomLocale) DoesNotMatchPattern() string

DoesNotMatchPattern ...

func (CustomLocale) Duplicated

func (l CustomLocale) Duplicated() string

Duplicated ...

func (CustomLocale) Enum

func (l CustomLocale) Enum() string

Enum ...

func (CustomLocale) ErrorFormat

func (l CustomLocale) ErrorFormat() string

ErrorFormat ...

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) HttpBadStatus

func (l CustomLocale) HttpBadStatus() string

HttpBadStatus ...

func (CustomLocale) Internal

func (l CustomLocale) Internal() string

Internal ...

func (CustomLocale) InvalidPropertyName

func (l CustomLocale) InvalidPropertyName() string

InvalidPropertyName ...

func (CustomLocale) InvalidPropertyPattern

func (l CustomLocale) InvalidPropertyPattern() string

InvalidPropertyPattern ...

func (CustomLocale) InvalidType

func (l CustomLocale) InvalidType() string

InvalidType ...

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) MultipleOf

func (l CustomLocale) MultipleOf() string

MultipleOf ...

func (CustomLocale) MustBeGTEZero

func (l CustomLocale) MustBeGTEZero() string

MustBeGTEZero ...

func (CustomLocale) MustBeOfA

func (l CustomLocale) MustBeOfA() string

MustBeOfA ...

func (CustomLocale) MustBeOfAn

func (l CustomLocale) MustBeOfAn() string

MustBeOfAn ...

func (CustomLocale) MustBeOfType

func (l CustomLocale) MustBeOfType() string

MustBeOfType ...

func (CustomLocale) MustBeValidFormat

func (l CustomLocale) MustBeValidFormat() string

MustBeValidFormat ...

func (CustomLocale) MustBeValidRegex

func (l CustomLocale) MustBeValidRegex() string

MustBeValidRegex ...

func (CustomLocale) NotAValidType

func (l CustomLocale) NotAValidType() string

NotAValidType ...

func (CustomLocale) NumberAllOf

func (l CustomLocale) NumberAllOf() string

NumberAllOf ...

func (CustomLocale) NumberAnyOf

func (l CustomLocale) NumberAnyOf() string

NumberAnyOf ...

func (CustomLocale) NumberGT

func (l CustomLocale) NumberGT() string

NumberGT ...

func (CustomLocale) NumberGTE

func (l CustomLocale) NumberGTE() string

NumberGTE ...

func (CustomLocale) NumberLT

func (l CustomLocale) NumberLT() string

NumberLT ...

func (CustomLocale) NumberLTE

func (l CustomLocale) NumberLTE() string

NumberLTE ...

func (CustomLocale) NumberNot

func (l CustomLocale) NumberNot() string

NumberNot ...

func (CustomLocale) NumberOneOf

func (l CustomLocale) NumberOneOf() string

NumberOneOf ...

func (CustomLocale) ParseError

func (l CustomLocale) ParseError() string

ParseError ...

func (CustomLocale) ReferenceMustBeCanonical

func (l CustomLocale) ReferenceMustBeCanonical() string

ReferenceMustBeCanonical ...

func (CustomLocale) RegexPattern

func (l CustomLocale) RegexPattern() string

RegexPattern ...

func (CustomLocale) Required

func (l CustomLocale) Required() string

Required returns a format-string for "required" schema validation errors

func (CustomLocale) StringGTE

func (l CustomLocale) StringGTE() string

StringGTE ...

func (CustomLocale) StringLTE

func (l CustomLocale) StringLTE() string

StringLTE ...

func (CustomLocale) Unique

func (l CustomLocale) Unique() string

Unique ...

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 ...

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier