Skip to content

Commit

Permalink
feat: add schemas for new discussion_comment event
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Mar 30, 2021
1 parent acdd7c1 commit 0f038dc
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 0 deletions.
129 changes: 129 additions & 0 deletions payload-schemas/schemas/discussion_comment/created.schema.json
Original file line number Diff line number Diff line change
@@ -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"
}
129 changes: 129 additions & 0 deletions payload-schemas/schemas/discussion_comment/deleted.schema.json
Original file line number Diff line number Diff line change
@@ -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"
}
Loading

0 comments on commit 0f038dc

Please sign in to comment.