-
Notifications
You must be signed in to change notification settings - Fork 164
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
Override gen annotation #446
Conversation
1ea21a7
to
65def1c
Compare
@@ -109,7 +109,8 @@ lazy val zioSchema = crossProject(JSPlatform, JVMPlatform) | |||
libraryDependencies ++= Seq( | |||
"dev.zio" %% "zio" % zioVersion, | |||
"dev.zio" %% "zio-streams" % zioVersion, | |||
"dev.zio" %% "zio-prelude" % zioPreludeVersion | |||
"dev.zio" %% "zio-prelude" % zioPreludeVersion, | |||
"dev.zio" %% "zio-test" % zioVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to include this in the zio-schema
project for the annotation definition, would it make sense for this annotation to live inside the zio-schema-zio-test
project to avoid including this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
Potentially working needs cleanup Add test to show it ignores a generator of a different type Remove type safety and test Formatting and test name fix Formatting and linting fixes formatting Formatting again
9306d79
to
e7b60e7
Compare
@vigoo Can we solve this problem by using the new type class derivation mechanism? |
If
The annotation solution proposed in this PR is a bit more powerful because it allows customizing separate generators per usage within a single derivation, while with the implicit based you could just overwrite it once (but it could achieve the same thing by introducing multiple scoped implicits and expicitly deriving the |
@@ -0,0 +1,5 @@ | |||
package zio.schema.annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to the zio-schema-zio-test
module?
@jdegoes anyway, rewriting |
@beem812 Happy to get this in. Please just re-open when conflicts are fixed and revisions are complete. Thank you! |
@generator()
annotation for specifying a different generator for the DeriveGen functionality to use. #438