lizhimins opened a new pull request, #6056:
URL: https://github.com/apache/rocketmq-dashboard/pull/6056

   #5262 made the studio client decode response payloads with 
`json.Decoder.UseNumber()` so integer
   literals survive instead of being folded into `float64`. `json.Number` is a 
string type: `encoding/json`
   marshals it as a bare literal, but `yaml.v3` does not know it, so every 
number in `-o yaml` output came
   out quoted (`size: "3"` instead of `size: 3`) and the payload no longer 
round-tripped to what the server
   sent. `TestMessageQueryCompletenessWarningTest` fails on all of its yaml 
subtests on current
   `rocketmq-studio` because of this.
   
   `YAML` now restores numeric types before encoding: integers become `int64` 
(so offsets past 2^53 stay
   exact, which is the reason `UseNumber()` is there at all), other numbers 
become `float64`, everything
   else is passed through. `JSON` and the table renderer are unchanged 
(`fmt.Sprint` on a `json.Number`
   already yields the literal).
   
   Added `TestYAMLRestoresJSONNumbersTest` covering an integer, a decimal, a 
2^53+1 offset and a nested
   array of objects. Mutation-checked: encoding the raw value again reddens 
both the new case and the
   yaml subtests of `TestMessageQueryCompletenessWarningTest`.
   
   `make fmt` clean; `go test ./...` green across all seven rmqctl packages 
(was red in `./cmd` before).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to