Closed cjslep closed 4 years ago
I've identified root cause: the generated Serialization function half-asses a solution. Firstly, property names never have the chance to be aliased. Secondly, the type name is being properly aliased... but then overwritten by the actual type property. The type property, since it is a JSON-LD special property, will need a bit of extra processing to preserve other type names that may be manually aliased, and preserve its own type name with the correct alias (eliminating a dupe or non-aliased dupe).
The solution I have in mind will still require people wanting to add multiple types, to handle that aliasing correctly on their own. Solving that will be very difficult, there isn't any immediate uses cases, and I don't want to spin on it.
I got the stuff to generate and serialize with proper aliasing:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"widsv": "https://w3id.org/security/v1"
}
],
"type": "Person",
"widsv:publicKey": {
"type": "widsv:PublicKey",
"widsv:publicKeyPem": "test PEM value"
}
}
Will push the code shortly.
Here is the fix in astool
: b5a6786f9edfb57f58275a20daf7b1f97ad00488
Here is the new generated code: e084b904b19552d8a165f5c79b2d295afd1fc8a1
As discussed in https://github.com/go-fed/activity/pull/118 and the associated links and threads, properties are not being serialized properly when voabularies in the context have a default JSON-LD alias.
Note that this won't be handled by Mastodon (and SocialHome?) right now, so may need to file issues against those projects.