forked from forgejo/forgejo
[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)
* Update go-swagger * vendor
This commit is contained in:
parent
66843f2237
commit
3270e7a443
350 changed files with 26353 additions and 5552 deletions
7
vendor/github.com/go-openapi/validate/validator.go
generated
vendored
7
vendor/github.com/go-openapi/validate/validator.go
generated
vendored
|
@ -452,6 +452,7 @@ func (s *basicSliceValidator) Validate(data interface{}) *Result {
|
|||
return nil
|
||||
}
|
||||
|
||||
/* unused
|
||||
func (s *basicSliceValidator) hasDuplicates(value reflect.Value, size int) bool {
|
||||
dict := make(map[interface{}]struct{})
|
||||
for i := 0; i < size; i++ {
|
||||
|
@ -463,6 +464,7 @@ func (s *basicSliceValidator) hasDuplicates(value reflect.Value, size int) bool
|
|||
}
|
||||
return false
|
||||
}
|
||||
*/
|
||||
|
||||
type numberValidator struct {
|
||||
Path string
|
||||
|
@ -530,6 +532,7 @@ func (n *numberValidator) Validate(val interface{}) *Result {
|
|||
// Is the provided value within the range of the specified numeric type and format?
|
||||
res.AddErrors(IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path))
|
||||
|
||||
// nolint: dupl
|
||||
if n.MultipleOf != nil {
|
||||
// Is the constraint specifier within the range of the specific numeric type and format?
|
||||
resMultiple.AddErrors(IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path))
|
||||
|
@ -546,6 +549,7 @@ func (n *numberValidator) Validate(val interface{}) *Result {
|
|||
}
|
||||
}
|
||||
|
||||
// nolint: dupl
|
||||
if n.Maximum != nil {
|
||||
// Is the constraint specifier within the range of the specific numeric type and format?
|
||||
resMaximum.AddErrors(IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path))
|
||||
|
@ -562,6 +566,7 @@ func (n *numberValidator) Validate(val interface{}) *Result {
|
|||
}
|
||||
}
|
||||
|
||||
// nolint: dupl
|
||||
if n.Minimum != nil {
|
||||
// Is the constraint specifier within the range of the specific numeric type and format?
|
||||
resMinimum.AddErrors(IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path))
|
||||
|
@ -611,7 +616,7 @@ func (s *stringValidator) Applies(source interface{}, kind reflect.Kind) bool {
|
|||
func (s *stringValidator) Validate(val interface{}) *Result {
|
||||
data, ok := val.(string)
|
||||
if !ok {
|
||||
return errorHelp.sErr(errors.InvalidType(s.Path, s.In, "string", val))
|
||||
return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val))
|
||||
}
|
||||
|
||||
if s.Required && !s.AllowEmptyValue && (s.Default == nil || s.Default == "") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue