diff --git a/map_validator/implements.go b/map_validator/implements.go index dd83947..8d1e1c3 100644 --- a/map_validator/implements.go +++ b/map_validator/implements.go @@ -64,10 +64,10 @@ func (state *dataState) LoadJsonHttp(r *http.Request) (*finalOperation, error) { var mapData map[string]interface{} err := json.NewDecoder(r.Body).Decode(&mapData) if err != nil { - if err.Error() == "EOF" { - return nil, ErrNoData + if err.Error() != "EOF" { + return nil, ErrInvalidJsonFormat } - return nil, ErrInvalidJsonFormat + mapData = make(map[string]interface{}) } if state.strictAllowedValue { if err := state.checkStrictKeys(mapData); err != nil {