tethys icon indicating copy to clipboard operation
tethys copied to clipboard

Is there reason why there is no emptyReader?

Open eugkhp opened this issue 5 years ago • 0 comments

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"?

eugkhp avatar Jan 22 '20 16:01 eugkhp