A JsonCodec[A] instance has the ability to encode values of type A into JSON, together with the ability to decode such JSON into values of type A.
Instances of this trait should satisfy round-tripping laws: that is, for every value, instances must be able to successfully encode the value into JSON, and then successfully decode the same value from such JSON.
For more information, see JsonDecoder and JsonEncoder.
{{ val intCodec: JsonCodec[Int] = JsonCodec[Int]
intCodec.encodeJson(intCodec.encodeJson(42)) == Right(42) }}
Attributes
- Companion
- object
- Source
- JsonCodec.scala
- Graph
-
- Supertypes
- Self type
-
JsonCodec[A]
Members list
Value members
Concrete methods
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
An alias for JsonCodec#zip.
An alias for JsonCodec#orElseEither.
An alias for JsonCodec#orElse.
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Attributes
- Source
- JsonCodec.scala
Inherited methods
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala