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

Derive Jason.Encoder for all exchanged messages #6

Closed
dsienkiewicz opened this issue Apr 24, 2023 · 0 comments · Fixed by #15
Closed

Derive Jason.Encoder for all exchanged messages #6

dsienkiewicz opened this issue Apr 24, 2023 · 0 comments · Fixed by #15
Labels
bug Something isn't working
Milestone

Comments

@dsienkiewicz
Copy link
Owner

dsienkiewicz commented Apr 24, 2023

Problem
Currently, not all exchanged messages derive from Jason.Encoder, which means they're not serializable to JSON.
There's a workaround for that - client could explicitly derive that protocol for needed structs.

Solution
The solution is two steps process:

  • use TypedStruct to make defining messages easier end less error prone
  • derive Jason.Encoder for all messages structs
@dsienkiewicz dsienkiewicz added the bug Something isn't working label Apr 24, 2023
@dsienkiewicz dsienkiewicz added this to the 0.2 milestone Apr 24, 2023
@dsienkiewicz dsienkiewicz changed the title Derive Jason.Ecoder for all exchanged messages Derive Jason.Encoder for all exchanged messages Apr 24, 2023
@dsienkiewicz dsienkiewicz linked a pull request Nov 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant