Documentation ¶
Index ¶
- func BindJSON(c *gin.Context, schemaStr string, obj interface{}) error
- func BindJSONSchema(c *gin.Context, schema *gojsonschema.Schema, obj interface{}) (err error)
- func Validate(handler gin.HandlerFunc, schemaStr string) gin.HandlerFunc
- func ValidateSchema(handler gin.HandlerFunc, schema *gojsonschema.Schema) gin.HandlerFunc
- type ErrCannotBuildSchema
- type ErrSchemaValidation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindJSONSchema ¶
func BindJSONSchema(c *gin.Context, schema *gojsonschema.Schema, obj interface{}) (err error)
func Validate ¶
func Validate(handler gin.HandlerFunc, schemaStr string) gin.HandlerFunc
func ValidateSchema ¶
func ValidateSchema(handler gin.HandlerFunc, schema *gojsonschema.Schema) gin.HandlerFunc
Types ¶
type ErrCannotBuildSchema ¶
type ErrCannotBuildSchema struct {
// contains filtered or unexported fields
}
func NewErrCannotBuildSchema ¶
func NewErrCannotBuildSchema(err error) *ErrCannotBuildSchema
func (*ErrCannotBuildSchema) Error ¶
func (e *ErrCannotBuildSchema) Error() string
type ErrSchemaValidation ¶
type ErrSchemaValidation struct {
Errors []string
}
func NewErrSchemaValidation ¶
func NewErrSchemaValidation(errors []string) *ErrSchemaValidation
func (*ErrSchemaValidation) Error ¶
func (e *ErrSchemaValidation) Error() string
Click to show internal directories.
Click to hide internal directories.