What is the correct way of setting the AP context?

This is related to : https://github.com/go-fed/activity/pull/118

Looking at friendica’s (@heluecht) context:

  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],

and mastodons:

{
  "@context":[
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "manuallyApprovesFollowers":"as:manuallyApprovesFollowers",

Would friendica accept following request as valid w3id-security extension?

  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "widsv": "https://w3id.org/security/v1"
    }
  ],

How will socialhome implement detecting extensions? @jaywink

Thanks :slight_smile:

Friendica is using some JSON-LD functions to validate and compact the incoming data. I haven’t checked, but I’m most likely sure that this won’t work.

Socialhome would work fine currently, because I haven’t done any JSON-LD magic yet - I’m just treating everything as JSON and pretty much ignoring the context’s. I will be adding a layer in between though that sits between the payloads and the JSON processing to ensure the JSON always looks the same.

As @heluecht said already, this example doesn’t look correct. How much problems will it cause I don’t know as I’ve not used a JSON-LD library yet.

FYI linking a Fediverse thread started by CJ here: https://mastodon.technology/@cj/102820213516163310