Skip to content

Commit

Permalink
fix: Encoder for VerificationMethodReferenced as String (#110)
Browse files Browse the repository at this point in the history
fix(mediator): encoder for the VerificationMethodReferenced

Signed-off-by: Shailesh Patil <[email protected]>
Signed-off-by: Shailesh Patil <[email protected]>
  • Loading branch information
mineme0110 committed May 1, 2024
1 parent 00c67cb commit ca44c41
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ given BSONDocumentWriter[Recipient] =
given BSONDocumentReader[Recipient] =
Macros.reader[Recipient]

given BSONDocumentWriter[VerificationMethodReferenced] =
Macros.writer[VerificationMethodReferenced]
given BSONDocumentReader[VerificationMethodReferenced] =
Macros.reader[VerificationMethodReferenced]
given BSONWriter[VerificationMethodReferenced] with {
def writeTry(obj: VerificationMethodReferenced): Try[BSONValue] = Try(BSONString(obj.value))
}
given BSONReader[VerificationMethodReferenced] with {
def readTry(bson: BSONValue): Try[VerificationMethodReferenced] =
bson.asTry[String].map(v => VerificationMethodReferenced(v))
}

given BSONDocumentWriter[RecipientHeader] =
Macros.writer[RecipientHeader]
Expand Down

0 comments on commit ca44c41

Please sign in to comment.