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

Compatibility with built_value for serialization #2

Open
realcr opened this issue Jan 16, 2020 · 3 comments
Open

Compatibility with built_value for serialization #2

realcr opened this issue Jan 16, 2020 · 3 comments

Comments

@realcr
Copy link

realcr commented Jan 16, 2020

Hi, thank you for your work on sum_types!
Is there a way to use sum_types together with built_value for serialization?

I am trying to create an interop between a Rust binary and a Flutter application, and sum_types looks very promising to allow representing something similar to Rust's enums. I am exploring possible serialization libs, and I found json_serializable and built_value. Checking the examples in this repository, I could find an example using json_serializable, but didn't find anywhere an example using built_value.

I prefer using built_value because it seems like it is more strict. That said, I am a beginner with dart, I was wondering what is your take on this. Thank you!

@werediver
Copy link
Owner

Hi @realcr! The fact that you're asking this question suggests that built_value cannot be applied in a way similar to how json_serializable can be. That sounds surprising, but I'd need to try it to answer, because I haven't used built_value.

If I find time this week, I'll take a look into it. Please post a message if you find a solution earlier!

@realcr
Copy link
Author

realcr commented Jan 31, 2020

Hey, I tried to solve this for the last two weeks. Check out:

@lelabo-m
Copy link

I would also be interested to know if it works with build_value.
In the mean time, I am checking @realcr solution.

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

3 participants