diff --git a/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala b/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala index 323a377d0f..5e5661016b 100644 --- a/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala +++ b/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala @@ -1,7 +1,7 @@ package org.hyperledger.identus.mercury.model import zio.json.ast.Json -import zio.json.EncoderOps +import zio.json.DecoderOps import java.util.Base64 @@ -9,7 +9,8 @@ trait EncryptedMessage { // (private val msg: PackEncryptedResult) { def string: String // = msg.getPackedMessage def base64: String = Base64.getUrlEncoder.encodeToString(string.getBytes) def asJson: Json.Obj = { - string.toJsonAST + string + .fromJson[Json] .flatMap(o => o.asObject match case None => Left(RuntimeException(s"Expecting Json Object got '$o'"))