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:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user