Skip to content

command line tool

Installation

Install the package via

pip install funfedi_schema

The funfedi-schema command should then become available.

Validating an ActivityPub object

Suppose you have an ActivityPub object, e.g.

./examples/activity_pub/example2.json
{
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Note",
    "to": [
        "https://chatty.example/ben/"
    ],
    "attributedTo": "https://social.example/alyssa/",
    "content": "Say, did you finish reading that book I lent you?"
}

Then one can validate it using the command line tool using

funfedi-schema validate-activity-pub-object \
    ./examples/activity_pub/example2.json

The then generated output is

schema is invalid
'id' is a required property


schema_after_normalization is invalid
'id' is a required property


activity_streams_json_ld_compacted is invalid
[
  [
    "change",
    "to",
    [
      [
        "https://chatty.example/ben/"
      ],
      "https://chatty.example/ben/"
    ]
  ]
]