A purely-functional library for defining type-safe schemas for algebraic data types, providing free generators, SQL queries, JSON codecs, binary codecs, and migration from this schema definition
We should now have enough material to try and implement a first serializer.
The main idea is to implement a function like the following:
def jsonSerializer[A](schema: Schema[A])(implicit prims: ToJson[Prim[A]]): A => JSON = ???
Where ToJson is a simple typeclass needed to convert the primitive types of the module to JSON.
The actual JSON representation isn't very important for now, we can just define type JSON = String for the moment.
We should now have enough material to try and implement a first serializer.
The main idea is to implement a function like the following:
Where
ToJson
is a simple typeclass needed to convert the primitive types of the module to JSON. The actualJSON
representation isn't very important for now, we can just definetype JSON = String
for the moment.