AsRoot

trait AsRoot[A] extends Encoder[A]

A subtype of Encoder that statically verifies that the instance encodes either a JSON array or an object.

Companion:
object
Source:
Encoder.scala
trait Encoder[A]
trait Serializable
class Object
trait Matchable
class Any
trait AsRoot[A]
trait AsArray[A]
trait AsObject[A]
trait AsArray[A]
trait AsObject[A]

Value members

Inherited methods

def apply(a: A): Json

Convert a value to JSON.

Convert a value to JSON.

Inherited from:
Encoder
Source:
Encoder.scala
final def contramap[B](f: B => A): Encoder[B]

Create a new Encoder by applying a function to a value of type B before encoding as an A.

Create a new Encoder by applying a function to a value of type B before encoding as an A.

Inherited from:
Encoder
Source:
Encoder.scala
final def mapJson(f: Json => Json): Encoder[A]

Create a new Encoder by applying a function to the output of this one.

Create a new Encoder by applying a function to the output of this one.

Inherited from:
Encoder
Source:
Encoder.scala