0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/spec/requests/api/schemas/json/post_action_response.json
Blake Erickson faefa28792
DEV: Update api doc specs for post actions (#35428)
This change updates the api doc specs for `/post_actions.json` endpoint
so that it uses the new json schema format.
2025-10-15 17:01:08 -06:00

326 lines
No EOL
9.4 KiB
JSON
Vendored

{
"additionalProperties": true,
"properties": {
"id": {
"type": "integer",
"description": "The ID of the post"
},
"name": {
"type": "string",
"description": "The name of the post author"
},
"username": {
"type": "string",
"description": "The username of the post author"
},
"avatar_template": {
"type": "string",
"description": "Template for the author's avatar URL"
},
"created_at": {
"type": "string",
"description": "When the post was created"
},
"cooked": {
"type": "string",
"description": "The HTML content of the post"
},
"post_number": {
"type": "integer",
"description": "The post number within the topic"
},
"post_type": {
"type": "integer",
"description": "The type of post"
},
"posts_count": {
"type": "integer",
"description": "Total posts count for the user"
},
"updated_at": {
"type": "string",
"description": "When the post was last updated"
},
"reply_count": {
"type": "integer",
"description": "Number of replies to this post"
},
"reply_to_post_number": {
"type": [
"string",
"null"
],
"description": "Post number this post is replying to"
},
"quote_count": {
"type": "integer",
"description": "Number of times this post has been quoted"
},
"incoming_link_count": {
"type": "integer",
"description": "Number of incoming links to this post"
},
"reads": {
"type": "integer",
"description": "Number of reads"
},
"readers_count": {
"type": "integer",
"description": "Number of readers"
},
"score": {
"type": "number",
"description": "Post score"
},
"yours": {
"type": "boolean",
"description": "Whether this post belongs to the current user"
},
"topic_id": {
"type": "integer",
"description": "ID of the topic this post belongs to"
},
"topic_slug": {
"type": "string",
"description": "Slug of the topic this post belongs to"
},
"display_username": {
"type": "string",
"description": "Display username of the post author"
},
"primary_group_name": {
"type": [
"string",
"null"
],
"description": "Primary group name of the author"
},
"flair_name": {
"type": [
"string",
"null"
],
"description": "Flair name of the author"
},
"flair_url": {
"type": [
"string",
"null"
],
"description": "Flair URL of the author"
},
"flair_bg_color": {
"type": [
"string",
"null"
],
"description": "Flair background color of the author"
},
"flair_color": {
"type": [
"string",
"null"
],
"description": "Flair color of the author"
},
"flair_group_id": {
"type": [
"integer",
"null"
],
"description": "Flair group ID of the author"
},
"badges_granted": {
"type": "array",
"description": "Badges granted to the user"
},
"version": {
"type": "integer",
"description": "Version number of the post"
},
"can_edit": {
"type": "boolean",
"description": "Whether the current user can edit this post"
},
"can_delete": {
"type": "boolean",
"description": "Whether the current user can delete this post"
},
"can_recover": {
"type": "boolean",
"description": "Whether the current user can recover this post"
},
"can_see_hidden_post": {
"type": "boolean",
"description": "Whether the current user can see hidden posts"
},
"can_wiki": {
"type": "boolean",
"description": "Whether the current user can wiki this post"
},
"user_title": {
"type": [
"string",
"null"
],
"description": "Title of the post author"
},
"bookmarked": {
"type": "boolean",
"description": "Whether the post is bookmarked by the current user"
},
"actions_summary": {
"type": "array",
"description": "Summary of actions performed on this post",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"id": {
"type": "integer",
"description": "ID of the action type (e.g., 2 for like)"
},
"count": {
"type": "integer",
"description": "Number of times this action has been performed"
},
"acted": {
"type": "boolean",
"description": "Whether the current user has performed this action"
},
"can_undo": {
"type": "boolean",
"description": "Whether the current user can undo this action"
},
"can_act": {
"type": "boolean",
"description": "Whether the current user can perform this action"
}
}
}
},
"moderator": {
"type": "boolean",
"description": "Whether the post author is a moderator"
},
"admin": {
"type": "boolean",
"description": "Whether the post author is an admin"
},
"staff": {
"type": "boolean",
"description": "Whether the post author is staff"
},
"user_id": {
"type": "integer",
"description": "ID of the post author"
},
"hidden": {
"type": "boolean",
"description": "Whether the post is hidden"
},
"trust_level": {
"type": "integer",
"description": "Trust level of the post author"
},
"deleted_at": {
"type": [
"string",
"null"
],
"description": "When the post was deleted"
},
"user_deleted": {
"type": "boolean",
"description": "Whether the post was deleted by the user"
},
"edit_reason": {
"type": [
"string",
"null"
],
"description": "Reason for the last edit"
},
"can_view_edit_history": {
"type": "boolean",
"description": "Whether the current user can view edit history"
},
"wiki": {
"type": "boolean",
"description": "Whether this is a wiki post"
},
"reviewable_id": {
"type": [
"integer",
"null"
],
"description": "ID of the reviewable if this post is under review"
},
"reviewable_score_count": {
"type": "integer",
"description": "Number of reviewable scores"
},
"reviewable_score_pending_count": {
"type": "integer",
"description": "Number of pending reviewable scores"
},
"post_url": {
"type": "string",
"description": "URL of the post"
}
},
"required": [
"id",
"name",
"username",
"avatar_template",
"created_at",
"cooked",
"post_number",
"post_type",
"posts_count",
"updated_at",
"reply_count",
"reply_to_post_number",
"quote_count",
"incoming_link_count",
"reads",
"readers_count",
"score",
"yours",
"topic_id",
"topic_slug",
"display_username",
"primary_group_name",
"flair_name",
"flair_url",
"flair_bg_color",
"flair_color",
"flair_group_id",
"badges_granted",
"version",
"can_edit",
"can_delete",
"can_recover",
"can_see_hidden_post",
"can_wiki",
"user_title",
"bookmarked",
"actions_summary",
"moderator",
"admin",
"staff",
"user_id",
"hidden",
"trust_level",
"deleted_at",
"user_deleted",
"edit_reason",
"can_view_edit_history",
"wiki",
"reviewable_id",
"reviewable_score_count",
"reviewable_score_pending_count",
"post_url"
]
}