bosprimigenious opened a new issue, #1079:
URL: https://github.com/apache/dubbo-go-pixiu/issues/1079
### Environment
Current develop `51198ddd8d1317f6c1d7e351fde8a6be7da60d62`, Go 1.25.14 on
macOS arm64, repository go.mod/go.sum unchanged; Hessian 1.13.2 is already a
declared dependency.
### What happened
`util.NewDubboResponse` silently drops nil-valued entries from
`map[any]any`, whereas the same payload in `map[string]any` preserves the entry
as JSON `null`. Nested generic maps and maps inside slices lose fields as well.
The production HTTP connection manager's generic-response branch calls this API.
### Reproduction
```go
encoder := hessian.NewEncoder()
err := encoder.Encode(map[string]any{"nullable": nil, "zero": int32(0)})
if err != nil { panic(err) }
decoded, err := hessian.NewDecoder(encoder.Buffer()).Decode()
if err != nil { panic(err) }
fmt.Printf("%T %v\n", decoded, decoded)
fmt.Println(string(util.NewDubboResponse(decoded, false).Data))
```
Imports: `fmt`, `github.com/apache/dubbo-go-hessian2` (as `hessian`),
`github.com/apache/dubbo-go-pixiu/pkg/common/util`.
The real decoder returns a generic map with both keys still present. Actual
Pixiu JSON is `{"zero":0}`; expected is `{"nullable":null,"zero":0}`. A direct
`map[string]any{"nullable":nil,"zero":0}` control already returns the expected
JSON.
### Root cause and proposed scope
`mapIItoMapSI` continues immediately on `v == nil`. Preserve ordinary
nil-valued entries before continuing, after the existing `class` metadata
filter. Keep filtering `class`, including when its value is nil. Do not change
typed-nil map/slice behavior, byte handling, key conversion or ignored
JSON-marshal errors in this patch.
The bug was reproduced on unchanged source through the exported API and with
a real local Hessian encode/decode round-trip. This does not claim a live Dubbo
provider/RPC or complete gateway deployment test. Public open PR files and
all-state searches were checked; #569 concerned malformed provider JSON rather
than this conversion step.
AI disclosure: OpenAI Codex produced the implementation proposal, tests,
report and automated verification; no human line-by-line review is claimed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]