Fix(cuex): keep numbers in an external provider's reply as written

Merged
BR
1d ago
+38-2

Description of your changes

An external provider's reply was decoded with encoding/json into map[string]any, so every number came back as a float64. CUE then held an HTTP status of 200 as a float: it interpolates as 2E+2 and doesn't unify with int, and an integer above 2^53 lost its last digits.

The reply is now read by CUE's own JSON decoder, which keeps an integer an int and every digit it was sent. A reply that isn't a JSON object is still an error.

How has this code been tested?

TestExternalProviderFnKeepsNumbersAsWritten serves a reply with an int status, a float and an integer above 2^53, and checks both Call and CallForResult keep each as written and the status unifies with int. go test ./cue/cuex/runtime/ passes.


Summary by cubic

Keeps numbers in external provider replies as written. Replies were decoded with encoding/json into map[string]any, turning every number into a float64, so an HTTP status of 200 became 2E+2 and integers above 2^53 lost digits. The reply is now read by CUE's own JSON decoder, which preserves integer kind and full precision. Replies that aren't JSON objects still return an error.