From bf88b05e3489bfeef5a41532b148bffd01b6ea56 Mon Sep 17 00:00:00 2001 From: silverpill Date: Fri, 10 Apr 2026 17:08:18 +0200 Subject: [PATCH] FEP-9967: Add JSON schema (#814) + Update implementation list Reviewed-on: https://codeberg.org/fediverse/fep/pulls/814 Co-authored-by: silverpill Co-committed-by: silverpill --- fep/9967/fep-9967.md | 5 ++ fep/9967/question.schema.json | 109 ++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 fep/9967/question.schema.json diff --git a/fep/9967/fep-9967.md b/fep/9967/fep-9967.md index 6f28d31..4dac642 100644 --- a/fep/9967/fep-9967.md +++ b/fep/9967/fep-9967.md @@ -162,6 +162,11 @@ The method of identifying votes described in this document is not reliable becau This document is based on implementations of polls in Mastodon and Pleroma. +Several projects announced support for this FEP after it was published: + +- [Ktistec](https://epiktistes.com/ktistec/release/3.2.4) +- [Mitra](https://codeberg.org/silverpill/mitra/src/commit/5d41eb611a9cfa3466955475dace145a82d11f2d/FEDERATION.md#supported-feps) + ## References - Christine Lemmer-Webber, Jessica Tallon, Erin Shepherd, Amy Guy, Evan Prodromou, [ActivityPub], 2018 diff --git a/fep/9967/question.schema.json b/fep/9967/question.schema.json new file mode 100644 index 0000000..4a05f10 --- /dev/null +++ b/fep/9967/question.schema.json @@ -0,0 +1,109 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Poll", + "type": "object", + "properties": { + "id": { + "description": "Poll ID", + "type": "string", + "format": "uri" + }, + "type": { + "const": "Question" + }, + "attributedTo": { + "description": "ID of the actor who created this poll", + "type": "string", + "format": "uri" + }, + "content": { + "description": "Description of this poll (HTML)", + "type": "string" + }, + "endTime": { + "description": "The end date of the poll", + "type": "string", + "format": "date-time" + }, + "oneOf": { + "description": "Poll options", + "type": "array", + "items": {"$ref": "#/$defs/PollOption"} + }, + "anyOf": { + "description": "Poll options", + "type": "array", + "items": {"$ref": "#/$defs/PollOption"} + }, + "to": { + "description": "Poll's intended audience", + "oneOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + } + ] + + }, + "updated": { + "description": "The date when the last vote was received", + "type": "string", + "format": "date-time" + } + }, + "oneOf": [ + { + "required": [ + "id", + "type", + "attributedTo", + "content", + "oneOf", + "to" + ] + }, + { + "required": [ + "id", + "type", + "attributedTo", + "content", + "anyOf", + "to" + ] + } + ], + "$defs": { + "PollOption": { + "type": "object", + "properties": { + "type": { + "constant": "Note" + }, + "name": { + "description": "The name of the poll option", + "type": "string" + }, + "replies": { + "type": "object", + "properties": { + "type": { + "const": "Collection" + }, + "totalItems": { + "description": "Total number of votes towards this option", + "type": "integer" + } + } + } + } + } + } +}