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

Support for Annotations on all types #125

Closed
dmitrykozinets opened this issue Sep 21, 2021 · 7 comments
Closed

Support for Annotations on all types #125

dmitrykozinets opened this issue Sep 21, 2021 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers ziohackathon

Comments

@dmitrykozinets
Copy link
Contributor

dmitrykozinets commented Sep 21, 2021

Annotation support is needed on all types not just on Record.

Currently records support annotations, but it would be useful to also support annotations on all Schema types.

https://github.com/zio/zio-schema/blob/main/zio-schema/shared/src/main/scala/zio/schema/Schema.scala#L218

@thinkharderdev thinkharderdev added ziohackathon enhancement New feature or request good first issue Good for newcomers labels Oct 20, 2021
@alexvanolst
Copy link
Contributor

I'd like to pick this one up.

@alexvanolst
Copy link
Contributor

Other than Enum / Case is there anything left to do here? Happy to pick up the rest post hackathon if someone can point out any gaps.

@dmitrykozinets
Copy link
Contributor Author

@alexvanolst Thank you for picking this up!
We were thinking of adding annotation on all types and doing something like this:

sealed trait Schema[A] {
   def annotations: Chunk[Any]
}

@thinkharderdev @DamianReeves what do you think?

@thinkharderdev
Copy link
Contributor

Yes! I think we ultimately want to allow annotating any schema.

@DamianReeves
Copy link
Contributor

DamianReeves commented Nov 2, 2021 via email

@alexvanolst
Copy link
Contributor

I've opened a draft PR that gets it compiling with annotations added to the Schema trait.

Will probably need some feedback on what the desired behaviour is before it's merge-able since they don't do much right now.

@thinkharderdev
Copy link
Contributor

Closed by #147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers ziohackathon
Projects
None yet
Development

No branches or pull requests

4 participants