fix: change Validators type, check json body format

This commit is contained in:
buyuxiang
2022-03-01 18:05:13 +08:00
parent c144d14a4e
commit b04a57eb09
7 changed files with 40 additions and 26 deletions

View File

@@ -114,8 +114,12 @@ func (v *responseObject) Extract(extractors map[string]string) map[string]interf
return extractMapping
}
func (v *responseObject) Validate(validators []Validator, variablesMapping map[string]interface{}) (err error) {
for _, validator := range validators {
func (v *responseObject) Validate(iValidators []interface{}, variablesMapping map[string]interface{}) (err error) {
for _, iValidator := range iValidators {
validator, ok := iValidator.(Validator)
if !ok {
return errors.New("validator type error")
}
// parse check value
checkItem := validator.Check
var checkValue interface{}