rpc: convert null value to a defaultT

Right now we convert it is unmarshaler into a float64(0)
so an error is supressed.
This commit is contained in:
Evgenii Stratonikov 2020-06-08 16:38:44 +03:00 committed by Roman Khimov
parent bed08d3f89
commit d550e539ba
2 changed files with 9 additions and 1 deletions

View file

@ -243,6 +243,11 @@ func (p *Param) UnmarshalJSON(data []byte) error {
{ArrayT, &[]Param{}},
}
if bytes.Equal(data, []byte("null")) {
p.Type = defaultT
return nil
}
for _, cur := range attempts {
r := bytes.NewReader(data)
jd := json.NewDecoder(r)