hyperledger / aries-rfcs

Hyperledger Aries is infrastructure for blockchain-rooted, peer-to-peer interactions
https://hyperledger.github.io/aries-rfcs/
Apache License 2.0
326 stars 217 forks source link

Is a JSON string valid to be used in attachment data `json`? #808

Open TimoGlastra opened 10 months ago

TimoGlastra commented 10 months ago

When using attachments with the json keyword, it is expected that the value is JSON.

JSON also sees an ecoded string (e.g. "Timo") as valid JSON, so are these also allowed as the value for JSON attachments, or are only JSON arrays and JSON objects allowed and should the base64 encoding be used in this case (there's no need to re-encode really, we already have a base type of JSON).

See https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON#other_notes for note that any json value is valid JSON in itself