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

Generic derivation of schemas #48

Open
vil1 opened this issue Jan 20, 2019 · 4 comments
Open

Generic derivation of schemas #48

vil1 opened this issue Jan 20, 2019 · 4 comments
Labels

Comments

@vil1
Copy link
Member

vil1 commented Jan 20, 2019

Building upon #47, it seems rather obvious that we should be able to automatically derive the schema of any ADT at compile time (as a matter of fact, this gist achieves just that, using shapeless).

Like to #47, this should be provided in the generic (sbt) module, with no impact on the existing API for constructing schemas.

Also, if #34 gets merged before this issue is solved, words must be added in the documentations to stress out the fact that such fully automatic derivation should be used with caution, for it somehow defeats the purpose of having schemas as runtime values (in scenarios where schema evolution is a needed feature, it OK to fully derive schemas at compile time, as long as the application stores the derived schema somewhere at runtime).

@sasiharan
Copy link

@vil1, Had a discussion with @GrafBlutwurst about the gist code you shared in the issue for understanding. I will modify this gist code to align with latest schema encoding and raise a PR to take it forward.

@vil1
Copy link
Member Author

vil1 commented Jan 28, 2019

@sasiharan that's great news!

FTR, the mentioned gist is here

Please note that it might be easier to first work on #47 and then use that work to solve this issue (that is, the stuff around the Constructor typeclass in the gist).

Also, I'd prefer we use scalaz-deriving for this instead of shapeless for our generic derivation mechanisms. I'm not yet knowledgeable with it to be able to give you any guidance, but I intend to learn more about it soon (and I can also bring in people who know it well).

@sasiharan
Copy link

Agreed that #44 and #47 needs to be addressed before working on this issue. I will also go through scalaz-deriving and see how we can achieve auto derivation of Isos and Schemas.

@vil1
Copy link
Member Author

vil1 commented Jan 29, 2019

Don't worry too much about #44 though, it might take a while to be solved. And if it ever has an impact on your work, I'll take care of it as much as possible.

@vil1 vil1 added the mvp label Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants