feature: make all marshal/unmarshal functions in `client/encode_decode.go` public
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 583
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 15
Description
It would be very nice to have all marshal/unmarshal private function in `client/encode_decode.go` to be public as it
enables better integration testing, withhout having to do it manuall again. So having that feature I can do
Scenario:
```go
endpoint := cl.GetContract()
req := cm.GetContractPayload{Token: token, ID: id}
resp, err = endpoint(ctx, &req) // type "Contract"
// you wanna reuse that `resp` type directly with another endpoint.
// if `encode_decode.go` unmarshal/marshal stuff would be public
// I could do
endpoint := cl.GetBanana()
req2 := cm.GetBananaPayload{Token: token, ID: id}
resp2, err = endpoint(ctx, unmarshalContractToContractRequestBody(resp) ) // marshal/unmarshal to "ContractRequestBody"
```
Contributor guide
Assessment
This issue has not been assessed yet.