Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace metadata request map type with json.RawMessage type #16

Closed
yorhodes opened this issue Apr 30, 2020 · 1 comment · Fixed by #19
Closed

Replace metadata request map type with json.RawMessage type #16

yorhodes opened this issue Apr 30, 2020 · 1 comment · Fixed by #19
Labels
enhancement New feature or request

Comments

@yorhodes
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It is cumbersome to use the map type for marshalling and unmarshalling within the Celo client and server implementations because validation must be done on an enumerated list of key strings.

https://github.com/coinbase/rosetta-sdk-go/blob/2989e4b865ead7997719ce23c7d1ce3a941d6c74/types/metadata_request.go#L22

Describe the solution you'd like
I would like to be able to codegen marshallers as defined by the shape of our structs and validate metadata using these marshallers.

Describe alternatives you've considered
None.

Additional context
See https://github.com/celo-org/rosetta/blob/c51cfc731a13672a34f78cafff42978bea3574c9/service/rpc/servicer.go#L397

@yorhodes yorhodes added the enhancement New feature or request label Apr 30, 2020
@patrick-ogrady
Copy link
Contributor

Very much agree that this will make the Metadata field much more powerful. In doing some exploration for this change, found out you need to do some pretty crazy stuff to get reflect.DeepEqual to work on structs that contain json.RawMessage: https://play.golang.org/p/uME071lw_fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants