diff --git a/deepobject.go b/deepobject.go index 7ec2f02..4e81bbc 100644 --- a/deepobject.go +++ b/deepobject.go @@ -71,8 +71,10 @@ func MarshalDeepObject(i interface{}, paramName string) (string, error) { if err != nil { return "", fmt.Errorf("failed to marshal input to JSON: %w", err) } + e := json.NewDecoder(bytes.NewReader(buf)) + e.UseNumber() var i2 interface{} - err = json.Unmarshal(buf, &i2) + err = e.Decode(&i2) if err != nil { return "", fmt.Errorf("failed to unmarshal JSON: %w", err) }