From 90b05efa072f079b5a0f16d6ae74315438e9cb33 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Fri, 29 Mar 2024 10:59:46 +0100 Subject: [PATCH] Fix docs of the Translation entity The poll attribute is an object, not an array. --- content/en/entities/Translation.md | 48 +++++++++++++++++++----------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/content/en/entities/Translation.md b/content/en/entities/Translation.md index 0b664c1c..4eb5506c 100644 --- a/content/en/entities/Translation.md +++ b/content/en/entities/Translation.md @@ -20,7 +20,7 @@ Translation of status with content warning and media "spoiler_text": "Greatings ahead", "media_attachments": [ { - "id": 22345792, + "id": "22345792", "description": "Status author waving at the camera" } ], @@ -36,19 +36,17 @@ Translation of status with poll: "content": "

Should I stay or should I go?

", "spoiler_text": "", "media_attachments": [], - "poll": [ - { - "id": 34858, - "options": [ - { - "title": "Stay" - }, - { - "title": "Go" - } - ] - } - ], + "poll": { + "id": "34858", + "options": [ + { + "title": "Stay" + }, + { + "title": "Go" + } + ] + }, "detected_source_language": "ja", "provider": "DeepL.com" } @@ -73,8 +71,8 @@ Translation of status with poll: ### `poll` {#poll} -**Description:** The translated poll options of the status.\ -**Type:** Array\ +**Description:** The translated poll of the status.\ +**Type:** [Translation::Poll](#Poll)\ **Version history:**\ 4.2.0 - added @@ -99,8 +97,24 @@ Translation of status with poll: **Version history:**\ 4.0.0 - added +## Translation::Poll attributes {#Poll} + +### `id` {#Poll-id} + +**Description:** The ID of the Poll.\ +**Type:** String (cast from an integer, but not guaranteed to be a number)\ +**Version history:**\ +4.2.0 - added + +### `options` {#Poll-options} + +**Description:** The translated poll options.\ +**Type:** Array\ +**Version history:**\ +4.2.0 - added + ## See also {{< page-relref ref="methods/statuses#translate" caption="POST /api/v1/statuses/:id/translate" >}} -{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/translation_serializer.rb" caption="app/serializers/rest/translation_serializer.rb" >}} \ No newline at end of file +{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/translation_serializer.rb" caption="app/serializers/rest/translation_serializer.rb" >}}