discourse/spec/requests/api/schemas/json/post_show_response.json
Blake Erickson d289b20858
DEV: Add fetching likes info to api docs (#21028)
This commit adds some more detailed information about how to actually
get the number of likes for a post.

Also refactors some requests and responses into json schema files to
clean up the specs a bit.

See https://meta.discourse.org/t/69017/4?u=blake
2023-04-10 09:07:10 -06:00

267 lines
4.4 KiB
JSON

{
"additionalProperties": true,
"properties": {
"id": {
"type": "integer"
},
"username": {
"type": "string"
},
"avatar_template": {
"type": "string"
},
"created_at": {
"type": "string"
},
"cooked": {
"type": "string"
},
"post_number": {
"type": "integer"
},
"post_type": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
"reply_count": {
"type": "integer"
},
"reply_to_post_number": {
"type": [
"string",
"null"
]
},
"quote_count": {
"type": "integer"
},
"incoming_link_count": {
"type": "integer"
},
"reads": {
"type": "integer"
},
"readers_count": {
"type": "integer"
},
"score": {
"type": ""
},
"yours": {
"type": "boolean"
},
"topic_id": {
"type": "integer"
},
"topic_slug": {
"type": "string"
},
"primary_group_name": {
"type": [
"string",
"null"
]
},
"flair_name": {
"type": [
"string",
"null"
]
},
"flair_url": {
"type": [
"string",
"null"
]
},
"flair_bg_color": {
"type": [
"string",
"null"
]
},
"flair_color": {
"type": [
"string",
"null"
]
},
"version": {
"type": "integer"
},
"can_edit": {
"type": "boolean"
},
"can_delete": {
"type": "boolean"
},
"can_recover": {
"type": "boolean"
},
"can_wiki": {
"type": "boolean"
},
"user_title": {
"type": [
"string",
"null"
]
},
"bookmarked": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"actions_summary": {
"type": "array",
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"description": "`2`: like, `3`, `4`, `6`, `7`, `8`: flag"
},
"count": {
"type": "integer"
},
"acted": {
"type": "boolean"
},
"can_undo": {
"type": "boolean"
},
"can_act": {
"type": "boolean"
}
},
"required": [
"id"
]
}
]
},
"moderator": {
"type": "boolean"
},
"admin": {
"type": "boolean"
},
"staff": {
"type": "boolean"
},
"user_id": {
"type": "integer"
},
"hidden": {
"type": "boolean"
},
"trust_level": {
"type": "integer"
},
"deleted_at": {
"type": [
"string",
"null"
]
},
"user_deleted": {
"type": "boolean"
},
"edit_reason": {
"type": [
"string",
"null"
]
},
"can_view_edit_history": {
"type": "boolean"
},
"wiki": {
"type": "boolean"
},
"reviewable_id": {
"type": [
"string",
"null"
]
},
"reviewable_score_count": {
"type": "integer"
},
"reviewable_score_pending_count": {
"type": "integer"
},
"mentioned_users": {
"type": "array",
"items": [
]
},
"name": {
"type": [
"string",
"null"
]
},
"display_username": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"username",
"avatar_template",
"created_at",
"cooked",
"post_number",
"post_type",
"updated_at",
"reply_count",
"reply_to_post_number",
"quote_count",
"incoming_link_count",
"reads",
"readers_count",
"score",
"yours",
"topic_id",
"topic_slug",
"primary_group_name",
"flair_name",
"flair_url",
"flair_bg_color",
"flair_color",
"version",
"can_edit",
"can_delete",
"can_recover",
"can_wiki",
"user_title",
"bookmarked",
"raw",
"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"
]
}