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

   ### Description
   Fixes #3803
   
   Structs with a `time.Time` field could not be published to the 
ServiceDefinition, so the whole method was skipped and the service did not show 
up in Dubbo Admin.
   
   This PR maps `time.Time` to `java.util.Date`, which is what the hessian2 and 
generic paths already use at runtime:
   
   - Service definition: `time.Time` is published as a `java.util.Date` leaf 
type, including pointers, slices and map values. Squashing a `time.Time` is 
still rejected.
   - Generic call arguments: a `java.util.Date` value can be passed as 
milliseconds, `yyyy-MM-dd HH:mm:ss` (both match `PojoUtils.realize` in Dubbo 
Java), or an RFC 3339 string (what Go and Admin emit as JSON). Values nested in 
structs, pointers, slices and maps are realized too. Fractional milliseconds 
and malformed strings return an error.
   - Generic call results: `time.Time` is returned as is at any depth and 
encoded as Date by hessian2, instead of being expanded into an empty map. The 
bean generalizer emits a primitive descriptor, matching `JavaBeanSerializeUtil`.
   
   Verified end to end with Nacos 2.5.2, Dubbo Admin (develop) and the 
`UserProvider` sample from dubbo-go-samples: the service and its methods now 
appear in Admin with `time` shown as `java.util.Date`, and Admin debug 
invocation and the Go generic client both round-trip the time value in all 
three formats.
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] I have run `make fmt` to format my code
   - [x] I have run `make test` to run local tests
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   


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