From 0f038dccaf3e7af51579d813a6136f57c5222611 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 30 Mar 2021 18:33:42 -0400 Subject: [PATCH] feat: add schemas for new `discussion_comment` event --- .../discussion_comment/created.schema.json | 129 ++++++++++++++++ .../discussion_comment/deleted.schema.json | 129 ++++++++++++++++ .../discussion_comment/edited.schema.json | 143 ++++++++++++++++++ 3 files changed, 401 insertions(+) create mode 100644 payload-schemas/schemas/discussion_comment/created.schema.json create mode 100644 payload-schemas/schemas/discussion_comment/deleted.schema.json create mode 100644 payload-schemas/schemas/discussion_comment/edited.schema.json diff --git a/payload-schemas/schemas/discussion_comment/created.schema.json b/payload-schemas/schemas/discussion_comment/created.schema.json new file mode 100644 index 000000000..700155bf1 --- /dev/null +++ b/payload-schemas/schemas/discussion_comment/created.schema.json @@ -0,0 +1,129 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "discussion_comment$created", + "type": "object", + "required": [ + "action", + "comment", + "discussion", + "repository", + "sender", + "installation" + ], + "properties": { + "action": { "type": "string", "enum": ["created"] }, + "comment": { + "type": "object", + "required": [ + "id", + "node_id", + "html_url", + "parent_id", + "child_comment_count", + "repository_url", + "discussion_id", + "author_association", + "user", + "created_at", + "updated_at", + "body" + ], + "properties": { + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "html_url": { "type": "string" }, + "parent_id": { "type": "null" }, + "child_comment_count": { "type": "integer" }, + "repository_url": { "type": "string" }, + "discussion_id": { "type": "integer" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "user": { "$ref": "common/user.schema.json" }, + "created_at": { "type": "string" }, + "updated_at": { "type": "string" }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "discussion": { + "type": "object", + "required": [ + "repository_url", + "category", + "answer_html_url", + "answer_chosen_at", + "answer_chosen_by", + "html_url", + "id", + "node_id", + "number", + "title", + "user", + "state", + "locked", + "comments", + "created_at", + "updated_at", + "author_association", + "active_lock_reason", + "body" + ], + "properties": { + "repository_url": { "type": "string" }, + "category": { + "type": "object", + "required": [ + "id", + "repository_id", + "emoji", + "name", + "description", + "created_at", + "updated_at", + "slug", + "is_answerable" + ], + "properties": { + "id": { "type": "integer" }, + "repository_id": { "type": "integer" }, + "emoji": { "type": "string" }, + "name": { "type": "string" }, + "description": { "type": "string" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string" }, + "slug": { "type": "string" }, + "is_answerable": { "type": "boolean" } + }, + "additionalProperties": false + }, + "answer_html_url": { "type": ["string", "null"] }, + "answer_chosen_at": { "type": ["string", "null"] }, + "answer_chosen_by": { "type": ["string", "null"] }, + "html_url": { "type": "string" }, + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "number": { "type": "integer" }, + "title": { "type": "string" }, + "user": { "$ref": "common/user.schema.json" }, + "state": { "type": "string", "enum": ["open"] }, + "locked": { "type": "boolean" }, + "comments": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "active_lock_reason": { "type": ["string", "null"] }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "discussion_comment created event" +} diff --git a/payload-schemas/schemas/discussion_comment/deleted.schema.json b/payload-schemas/schemas/discussion_comment/deleted.schema.json new file mode 100644 index 000000000..6f3518afe --- /dev/null +++ b/payload-schemas/schemas/discussion_comment/deleted.schema.json @@ -0,0 +1,129 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "discussion_comment$deleted", + "type": "object", + "required": [ + "action", + "comment", + "discussion", + "repository", + "sender", + "installation" + ], + "properties": { + "action": { "type": "string", "enum": ["deleted"] }, + "comment": { + "type": "object", + "required": [ + "id", + "node_id", + "html_url", + "parent_id", + "child_comment_count", + "repository_url", + "discussion_id", + "author_association", + "user", + "created_at", + "updated_at", + "body" + ], + "properties": { + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "html_url": { "type": "string" }, + "parent_id": { "type": "null" }, + "child_comment_count": { "type": "integer" }, + "repository_url": { "type": "string" }, + "discussion_id": { "type": "integer" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "user": { "$ref": "common/user.schema.json" }, + "created_at": { "type": "string" }, + "updated_at": { "type": "string" }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "discussion": { + "type": "object", + "required": [ + "repository_url", + "category", + "answer_html_url", + "answer_chosen_at", + "answer_chosen_by", + "html_url", + "id", + "node_id", + "number", + "title", + "user", + "state", + "locked", + "comments", + "created_at", + "updated_at", + "author_association", + "active_lock_reason", + "body" + ], + "properties": { + "repository_url": { "type": "string" }, + "category": { + "type": "object", + "required": [ + "id", + "repository_id", + "emoji", + "name", + "description", + "created_at", + "updated_at", + "slug", + "is_answerable" + ], + "properties": { + "id": { "type": "integer" }, + "repository_id": { "type": "integer" }, + "emoji": { "type": "string" }, + "name": { "type": "string" }, + "description": { "type": "string" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string" }, + "slug": { "type": "string" }, + "is_answerable": { "type": "boolean" } + }, + "additionalProperties": false + }, + "answer_html_url": { "type": ["string", "null"] }, + "answer_chosen_at": { "type": ["string", "null"] }, + "answer_chosen_by": { "type": ["string", "null"] }, + "html_url": { "type": "string" }, + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "number": { "type": "integer" }, + "title": { "type": "string" }, + "user": { "$ref": "common/user.schema.json" }, + "state": { "type": "string", "enum": ["open"] }, + "locked": { "type": "boolean" }, + "comments": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "active_lock_reason": { "type": ["string", "null"] }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "discussion_comment deleted event" +} diff --git a/payload-schemas/schemas/discussion_comment/edited.schema.json b/payload-schemas/schemas/discussion_comment/edited.schema.json new file mode 100644 index 000000000..e7b698797 --- /dev/null +++ b/payload-schemas/schemas/discussion_comment/edited.schema.json @@ -0,0 +1,143 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "discussion_comment$edited", + "type": "object", + "required": [ + "action", + "changes", + "comment", + "discussion", + "repository", + "sender", + "installation" + ], + "properties": { + "changes": { + "type": "object", + "required": ["body"], + "properties": { + "body": { + "type": "object", + "required": ["from"], + "properties": { "from": { "type": "string" } }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "action": { "type": "string", "enum": ["edited"] }, + "comment": { + "type": "object", + "required": [ + "id", + "node_id", + "html_url", + "parent_id", + "child_comment_count", + "repository_url", + "discussion_id", + "author_association", + "user", + "created_at", + "updated_at", + "body" + ], + "properties": { + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "html_url": { "type": "string" }, + "parent_id": { "type": "null" }, + "child_comment_count": { "type": "integer" }, + "repository_url": { "type": "string" }, + "discussion_id": { "type": "integer" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "user": { "$ref": "common/user.schema.json" }, + "created_at": { "type": "string" }, + "updated_at": { "type": "string" }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "discussion": { + "type": "object", + "required": [ + "repository_url", + "category", + "answer_html_url", + "answer_chosen_at", + "answer_chosen_by", + "html_url", + "id", + "node_id", + "number", + "title", + "user", + "state", + "locked", + "comments", + "created_at", + "updated_at", + "author_association", + "active_lock_reason", + "body" + ], + "properties": { + "repository_url": { "type": "string" }, + "category": { + "type": "object", + "required": [ + "id", + "repository_id", + "emoji", + "name", + "description", + "created_at", + "updated_at", + "slug", + "is_answerable" + ], + "properties": { + "id": { "type": "integer" }, + "repository_id": { "type": "integer" }, + "emoji": { "type": "string" }, + "name": { "type": "string" }, + "description": { "type": "string" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string" }, + "slug": { "type": "string" }, + "is_answerable": { "type": "boolean" } + }, + "additionalProperties": false + }, + "answer_html_url": { "type": ["string", "null"] }, + "answer_chosen_at": { "type": ["string", "null"] }, + "answer_chosen_by": { "type": ["string", "null"] }, + "html_url": { "type": "string" }, + "id": { "type": "integer" }, + "node_id": { "type": "string" }, + "number": { "type": "integer" }, + "title": { "type": "string" }, + "user": { "$ref": "common/user.schema.json" }, + "state": { "type": "string", "enum": ["open"] }, + "locked": { "type": "boolean" }, + "comments": { "type": "integer" }, + "created_at": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "author_association": { + "$ref": "common/author_association.schema.json" + }, + "active_lock_reason": { "type": ["string", "null"] }, + "body": { "type": "string" } + }, + "additionalProperties": false + }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "discussion_comment edited event" +}