io.github.iltotore.iron.zioJson.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iron-zio-json_sjs1_3 Show documentation
Show all versions of iron-zio-json_sjs1_3 Show documentation
Strong type constraints for Scala
package io.github.iltotore.iron
import zio.json.{JsonDecoder, JsonEncoder}
object zioJson:
inline given [A, C](using inline decoder: JsonDecoder[A], constraint: Constraint[A, C]): JsonDecoder[A :| C] =
decoder.mapOrFail(_.refineEither)
inline given [A, C](using inline encoder: JsonEncoder[A]): JsonEncoder[A :| C] =
encoder.asInstanceOf[JsonEncoder[A :| C]]
inline given[T](using mirror: RefinedTypeOps.Mirror[T], ev: JsonDecoder[mirror.IronType]): JsonDecoder[T] =
ev.asInstanceOf[JsonDecoder[T]]
inline given[T](using mirror: RefinedTypeOps.Mirror[T], ev: JsonEncoder[mirror.IronType]): JsonEncoder[T] =
ev.asInstanceOf[JsonEncoder[T]]
© 2015 - 2025 Weber Informatics LLC | Privacy Policy