Enriches JsonSchemas with two kinds of operations:
Enriches JsonSchemas with two kinds of operations:
- genericJsonSchema[A] derives the JsonSchema of an algebraic
data type A;
- (field1 :×: field2 :×: …).as[A] builds a tuple of Records and maps
it to a case class A
The data type description derivation is based on the underlying
field and constructor names.
For instance, consider the following program that derives the description
of a case class:
Enriches JsonSchemas with two kinds of operations:
-
genericJsonSchema[A]
derives theJsonSchema
of an algebraic data typeA
; -(field1 :×: field2 :×: …).as[A]
builds a tuple ofRecord
s and maps it to a case classA
The data type description derivation is based on the underlying field and constructor names.
For instance, consider the following program that derives the description of a case class:
It is equivalent to the following: