[#3790] added MaxSize json field option
This commit is contained in:
@@ -612,10 +612,13 @@ func (o SelectOptions) IsMultiple() bool {
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
type JsonOptions struct {
|
||||
MaxSize int `form:"maxSize" json:"maxSize"`
|
||||
}
|
||||
|
||||
func (o JsonOptions) Validate() error {
|
||||
return nil
|
||||
return validation.ValidateStruct(&o,
|
||||
validation.Field(&o.MaxSize, validation.Required, validation.Min(1)),
|
||||
)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -623,10 +626,10 @@ func (o JsonOptions) Validate() error {
|
||||
var _ MultiValuer = (*FileOptions)(nil)
|
||||
|
||||
type FileOptions struct {
|
||||
MaxSelect int `form:"maxSelect" json:"maxSelect"`
|
||||
MaxSize int `form:"maxSize" json:"maxSize"` // in bytes
|
||||
MimeTypes []string `form:"mimeTypes" json:"mimeTypes"`
|
||||
Thumbs []string `form:"thumbs" json:"thumbs"`
|
||||
MaxSelect int `form:"maxSelect" json:"maxSelect"`
|
||||
MaxSize int `form:"maxSize" json:"maxSize"`
|
||||
Protected bool `form:"protected" json:"protected"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user