JsonDecoderInstances

org.sigilaris.core.codec.json.JsonDecoderInstances

Shared provider of JSON decoder instances parameterized by JsonConfig.

Subclassed by JsonDecoder (default config) and JsonDecoder.configured.Decoders (custom config).

Attributes

Source
JsonDecoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Decoders
object JsonDecoder

Members list

Value members

Abstract methods

protected def config: JsonConfig

Attributes

Source
JsonDecoder.scala

Concrete methods

protected def mk[A](f: (JsonValue, JsonConfig) => Either[DecodeFailure, A]): JsonDecoder[A]

Attributes

Source
JsonDecoder.scala
protected def typeMismatch[A](expected: String, got: JsonValue): Either[DecodeFailure, A]

Attributes

Source
JsonDecoder.scala

Givens

Givens

given bigDecimalDecoder: JsonDecoder[BigDecimal]

Decodes BigDecimal from JString or JNumber depending on config.

Decodes BigDecimal from JString or JNumber depending on config.

Attributes

Source
JsonDecoder.scala
given bigIntDecoder: JsonDecoder[BigInt]

Decodes BigInt from JString or JNumber depending on config.

Decodes BigInt from JString or JNumber depending on config.

Attributes

Source
JsonDecoder.scala
given booleanDecoder: JsonDecoder[Boolean]

Decodes JBool to Boolean.

Decodes JBool to Boolean.

Attributes

Source
JsonDecoder.scala
inline given derivedProductDecoder[A](using m: ProductOf[A]): JsonDecoder[A]

Derives a decoder for product types (case classes) by decoding each field from a JObject.

Derives a decoder for product types (case classes) by decoding each field from a JObject.

Attributes

Source
JsonDecoder.scala
inline given derivedSumDecoder[A](using m: SumOf[A]): JsonDecoder[A]

Derives a decoder for sum types (sealed traits/enums) using wrapped-by-type-key discriminator.

Derives a decoder for sum types (sealed traits/enums) using wrapped-by-type-key discriminator.

Attributes

Source
JsonDecoder.scala
given doubleDecoder: JsonDecoder[Double]

Decodes JNumber to Double.

Decodes JNumber to Double.

Attributes

Source
JsonDecoder.scala
given instantDecoder: JsonDecoder[Instant]

Decodes Instant from ISO-8601 JString.

Decodes Instant from ISO-8601 JString.

Attributes

Source
JsonDecoder.scala
given intDecoder: JsonDecoder[Int]

Decodes JNumber to Int.

Decodes JNumber to Int.

Attributes

Source
JsonDecoder.scala
given listDecoder[A : JsonDecoder]: JsonDecoder[List[A]]

Decodes JArray to List.

Decodes JArray to List.

Attributes

Source
JsonDecoder.scala
given longDecoder: JsonDecoder[Long]

Decodes JNumber to Long.

Decodes JNumber to Long.

Attributes

Source
JsonDecoder.scala
given mapDecoder[K : JsonKeyCodec, V : JsonDecoder]: JsonDecoder[Map[K, V]]

Decodes JObject to Map by converting field names with JsonKeyCodec.

Decodes JObject to Map by converting field names with JsonKeyCodec.

Fails on key parse errors or duplicate decoded keys after normalization.

Attributes

Source
JsonDecoder.scala
given optionDecoder[A : JsonDecoder]: JsonDecoder[Option[A]]

Decodes Option, treating JNull as None.

Decodes Option, treating JNull as None.

Attributes

Source
JsonDecoder.scala
given stringDecoder: JsonDecoder[String]

Decodes JString to String.

Decodes JString to String.

Attributes

Source
JsonDecoder.scala
given vectorDecoder[A : JsonDecoder]: JsonDecoder[Vector[A]]

Decodes JArray to Vector.

Decodes JArray to Vector.

Attributes

Source
JsonDecoder.scala