apache / dubbo-go-hessian2

caucho hessian2 implementation in Go for [apache/dubbo-go](https://github.com/apache/dubbo-go) which is compatible with [dubbo-hessian-lite](https://github.com/apache/dubbo-hessian-lite)
Apache License 2.0
209 stars 113 forks source link

javaBean返回的字段信息比struct多的时候,无法反序列化 #183

Closed bobopan closed 4 years ago

bobopan commented 4 years ago

英文不好,直接中文了

What would you like to be added:

golang反序列化的时候struct字段信息支持缺省字段

https://github.com/apache/dubbo-go-hessian2/blob/c4e7f352422864fb76182bfbe8adcaf298d86573/object.go#L342

Why is this needed: golang hessian2反序列化如果struct字段信息比javaBean字段信息少的时候,会出现反序列化失败的错误

micln commented 4 years ago

@wongoo does the err is necessary ?

wongoo commented 4 years ago

@wongoo does the err is necessary ?

Now hessian2 support ignore fields, but it's not the default behavior. I think it's possible to provide a global setting to allow user to change the default behavior.

How do you think? @AlexStocks @fangyincheng @micln @hxmhlt

AlexStocks commented 4 years ago

@wongoo agree with u.

fangyincheng commented 4 years ago

pr #201