Builds Play JSON Reads and Writes out of JSON schema definitions.
"org.julienrf" %% "endpoints-json-schema-playjson" % "0.15.0"
JsonSchemas interpreter fixes the
JsonSchema[A] type to a type that provides both a
Reads[A] and a
Given the following type definition:
sealed trait Shape case class Circle(radius: Double) extends Shape case class Rectangle(width: Double, height: Double) extends Shape
Assuming that there is an implicit
JsonSchema[Shape] definition, we can encode a
Shape into JSON and decode it using the usual Play JSON operations: