Skip to content

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

@gabyx

Description

@gabyx

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:

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions