Oxidaner opened a new pull request, #3504:
URL: https://github.com/apache/dubbo-go/pull/3504

   ## What changed
   
   - configure `MapGeneralizer.Realize` to decode struct fields using the `m` 
tag
   - add a round-trip regression test with a genuine field alias (`UserID` -> 
`user_id`)
   
   ## Why
   
   `MapGeneralizer.Generalize` already uses the `m` tag when producing map 
keys, but `Realize` previously called `mapstructure.Decode` with its default 
configuration. The default decoder reads `mapstructure` tags rather than `m` 
tags, so renamed fields were silently ignored and left at their zero values.
   
   Using the same tag in both directions restores symmetric map generalization 
and realization.
   
   ## Impact
   
   Generic calls using the default map generalizer now preserve values for 
fields whose `m` tag differs from the Go field name, including aliases such as 
`m:"user_id"`.
   
   ## Validation
   
   - `go test ./filter/generic/generalizer -run '^TestMTagRoundTrip$' -count=1 
-v`
   - `go test ./filter/generic/... -count=1`
   - `git diff --check -- filter/generic/generalizer/map.go 
filter/generic/generalizer/map_test.go`
   


-- 
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]

Reply via email to