Skip to content

Commit

Permalink
Merge pull request #3 from Rhyanz46/fixing/loadData
Browse files Browse the repository at this point in the history
fixing error on nullable value
  • Loading branch information
Rhyanz46 authored Nov 28, 2023
2 parents f5d43c7 + f38e9ac commit 90dd079
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions map_validator/implements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 90dd079

Please sign in to comment.