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

Is there reason why there is no emptyReader? #63

Open
eugkhp opened this issue Jan 22, 2020 · 0 comments
Open

Is there reason why there is no emptyReader? #63

eugkhp opened this issue Jan 22, 2020 · 0 comments

Comments

@eugkhp
Copy link

eugkhp commented Jan 22, 2020

I was wondering why there is default emptyWriter implementation https://github.com/tethys-json/tethys/blob/3ffbdb4cf27595580041a01f4b1e1bd98cb486f2/modules/core/src/main/scala/tethys/writers/EmptyWriters.scala and there is no emptyReader. For example:
i would like to serialize something like this:
case class Person[A](id: Int, names: List[A])
well, for encoding i can just write:
implicit val PersonEmptyWriter: JsonObjectWriter[Person[String]] = EmptyWriters.emptyWriter
but i can't do the same for decode something like this:
{id: 1, names: []}
so i have to write empty implementation of reader which is basiclly just signature of method.
Are there any reasons for not creating "EmptyReaders.emptyReader"?

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

1 participant