Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix decoding error when oob attachments contain json data #11

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

conanoc
Copy link
Contributor

@conanoc conanoc commented Dec 19, 2022

Checklist

  • I have run swiftlint
  • I have run AriesFrameworkTests
  • I have run AllTests

Description

Fix #9
Swift Decodable cannot decode untyped json. Requests of oob invitation will be AgentMessage types, but we don't know the exact type in advance.
This fix works as follows to handle this:

  • Change the json data of attachments to a String by serializing it
  • The string data will be treated the same as the decoded base64-encoded string
  • Use JSONSerialization to change the message instead of Codable protocol

Signed-off-by: conanoc <conanoc@gmail.com>
@conanoc conanoc merged commit 067e0ee into main Dec 19, 2022
@conanoc conanoc deleted the oob_json_embedding branch December 19, 2022 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

out-of-band invatation with request~attach embedding json can't be decoded
1 participant