kolo / xmlrpc

Implementation of XMLRPC protocol in Go language.
MIT License
158 stars 92 forks source link

marshal nil #78

Closed Amrf000 closed 3 years ago

Amrf000 commented 3 years ago

https://github.com/kolo/xmlrpc/blob/38db28db192bb84c8d980177f9d8ad8e7c58bbe3/encoder.go#L21 maybe => return []byte("<value><nil/></value>"), nil will appropriate for more people

icholy commented 3 years ago

@Amrf000 is there a specific bug you encountered?

mariosnikolaou commented 3 years ago

There is an old fork of this repo that does something related for encoding nil parameter values: https://github.com/eandre/xmlrpc/commit/cf41efa16a110b4f2e232e8c949f137b60f603e5

Encode nil parameter as the empty value

Previously nil values would be skipped in parameter lists
for outgoing requests."

I was using this other repo in an old project and noticed there was two commits to fix some issues perceived with this library. The other "issue" was https://github.com/eandre/xmlrpc/commit/f60accafb5b6bcea424bed796a3f148dd319fb32:

 Properly handle nil values for pointers
Amrf000 commented 3 years ago

@Amrf000 is there a specific bug you encountered?

I encountered some problems when i deserialize some data and pass them to python environment xmlrpc service.