1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 11:46:04 +00:00

FEP-9967: Add JSON schema (#814)

+ Update implementation list

Reviewed-on: https://codeberg.org/fediverse/fep/pulls/814
Co-authored-by: silverpill <silverpill@firemail.cc>
Co-committed-by: silverpill <silverpill@firemail.cc>
This commit is contained in:
silverpill
2026-04-10 17:08:18 +02:00
committed by silverpill
parent 85e1ef955d
commit bf88b05e34
2 changed files with 114 additions and 0 deletions
+5
View File
@@ -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
+109
View File
@@ -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"
}
}
}
}
}
}
}