goadesign / goadesign/goa

feature: make all marshal/unmarshal functions in `client/encode_decode.go` public

Open
#3,800 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.