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

drpc compatibility with regards to JSONMarshal and JSONUnmarshal. #25

Open
Tracked by #23
egonelbre opened this issue Jul 19, 2024 · 0 comments
Open
Tracked by #23

Comments

@egonelbre
Copy link
Member

egonelbre commented Jul 19, 2024

drpc expects JSONMarshal and JSONUnmarshal to be available. This mostly should be equivalent to just calling json.Marshal and json.Unmarshal.

func (drpcEncoding_File_certificate_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
	return picobuf.JSONMarshal(msg)
}

func (drpcEncoding_File_certificate_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
	return picobuf.JSONUnmarshal(buf, msg)
}

However, we may need to ensure and document that custom types may need a custom encoding as well. Either way, we need to verify that things work in a gogo-protobuf compatible way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant