Skip to content

PropertyValue attachments serialize with invalid type for AS2 Object/Link validation #629

@rmdes

Description

@rmdes

Description

When Fedify serializes actor attachment properties containing PropertyValue items (used by Mastodon for profile metadata fields), the resulting JSON-LD uses schema:PropertyValue as the type:

"attachment": [
  {
    "type": "PropertyValue",
    "name": "Website",
    "value": "<a href=\"https://example.com\">example.com</a>"
  }
]

The ActivityPub spec defines attachment as containing AS2 Object or Link types. PropertyValue is a schema.org type (https://schema.org/PropertyValue), not an ActivityStreams type. Strict validators like browser.pub reject this:

/attachment: ❌ Invalid object, Invalid link
/attachment/0/name: ✅ Valid activity property
/attachment/0/name: ✅ Valid xsd:string
/attachment/1/name: ✅ Valid activity property
/attachment/1/name: ✅ Valid xsd:string
/endpoints: ✅ Valid @id
/endpoints: ✅ Valid activity property
/endpoints: ✅ Valid single-value
/endpoints: ❌ Invalid endpoints, unknown properties: type (@type)
/endpoints/type: ❌ Type not found: as:Endpoints
/endpoints/sharedInbox: ✅ Valid @id
/endpoints/sharedInbox: ✅ Valid activity property
/endpoints/sharedInbox: ✅ Valid single-value
/endpoints/sharedInbox: ✅ Valid ordered collection

See the debug view on this page

Context

This is the same class of issue as #576 (Endpoints serializing with invalid as:Endpoints type), but for a different non-AS2 type. The PropertyValue type is used universally across the fediverse (Mastodon, Pleroma, Misskey, etc.) for profile metadata fields, so removing it would break compatibility.

The Dilemma

Unlike Endpoints, this is tricky because:

  1. Mastodon expects PropertyValue — removing the type breaks profile field display across the fediverse
  2. AS2 spec says attachment should contain Object or LinkPropertyValue is neither
  3. Every major fediverse server emits PropertyValue — it's a de facto standard despite not being in the AS2 vocabulary

Questions

  1. Is this something Fedify could address (perhaps by including the schema.org context so PropertyValue is properly defined)?
  2. Or is this a browser.pub strictness issue where the validator should accept widely-used extensions like PropertyValue?
  3. Should PropertyValue be treated similarly to how Mastodon's toot: namespace extensions are handled?

Environment

  • Fedify: ^1.10.3 (also affects 2.0)
  • Discovered via browser.pub validation of a Fedify-powered ActivityPub server

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions