Skip to content

Is there reason why there is no emptyReader? #63

Open
@eugkhp

Description

@eugkhp

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions