aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi/runtime/middleware/parameter.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-openapi/runtime/middleware/parameter.go')
-rw-r--r--vendor/github.com/go-openapi/runtime/middleware/parameter.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/go-openapi/runtime/middleware/parameter.go b/vendor/github.com/go-openapi/runtime/middleware/parameter.go
index 8975b6e1c8..8fa0cf4e46 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/parameter.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/parameter.go
@@ -24,11 +24,12 @@ import (
"strconv"
"github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
+
+ "github.com/go-openapi/runtime"
)
const defaultMaxMemory = 32 << 20
@@ -275,7 +276,7 @@ func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue in
}
if (!hasKey || (!p.parameter.AllowEmptyValue && data == "")) && p.parameter.Required && p.parameter.Default == nil {
- return errors.Required(p.Name, p.parameter.In)
+ return errors.Required(p.Name, p.parameter.In, data)
}
ok, err := p.tryUnmarshaler(target, defaultValue, data)
@@ -450,7 +451,7 @@ func (p *untypedParamBinder) readFormattedSliceFieldValue(data string, target re
func (p *untypedParamBinder) setSliceFieldValue(target reflect.Value, defaultValue interface{}, data []string, hasKey bool) error {
sz := len(data)
if (!hasKey || (!p.parameter.AllowEmptyValue && (sz == 0 || (sz == 1 && data[0] == "")))) && p.parameter.Required && defaultValue == nil {
- return errors.Required(p.Name, p.parameter.In)
+ return errors.Required(p.Name, p.parameter.In, data)
}
defVal := reflect.Zero(target.Type())