morphir.ir.documented.Codec.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of morphir-ir_3 Show documentation
Show all versions of morphir-ir_3 Show documentation
The morphir[3.3.4].ir.jvm.artifactName package
The newest version!
package morphir.ir.documented
/** Generated based on IR.Documented
*/
object Codec{
implicit def encodeDocumented[A](
encodeA: io.circe.Encoder[A]
): io.circe.Encoder[morphir.ir.Documented.Documented[A]] =
((documented: morphir.ir.Documented.Documented[A]) =>
io.circe.Json.obj(
("""doc""", morphir.sdk.string.Codec.encodeString(documented.doc)),
("""value""", encodeA(documented.value))
))
implicit def decodeDocumented[A](
decodeA: io.circe.Decoder[A]
): io.circe.Decoder[morphir.ir.Documented.Documented[A]] =
((c: io.circe.HCursor) =>
for {
doc_ <- c.downField("""doc""").as(morphir.sdk.string.Codec.decodeString)
value_ <- c.downField("""value""").as(decodeA)
} yield morphir.ir.Documented.Documented(
doc_,
value_
))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy