Skip to content

Commit 2275762

Browse files
authored
refactor: add new repository-lite common schema & add format to created_at, updated_at properties (#394)
1 parent 126e9d8 commit 2275762

File tree

3 files changed

+172
-316
lines changed

3 files changed

+172
-316
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "common/repository-lite.schema.json",
4+
"required": [
5+
"archive_url",
6+
"assignees_url",
7+
"blobs_url",
8+
"branches_url",
9+
"collaborators_url",
10+
"comments_url",
11+
"commits_url",
12+
"compare_url",
13+
"contents_url",
14+
"contributors_url",
15+
"deployments_url",
16+
"description",
17+
"downloads_url",
18+
"events_url",
19+
"fork",
20+
"forks_url",
21+
"full_name",
22+
"git_commits_url",
23+
"git_refs_url",
24+
"git_tags_url",
25+
"hooks_url",
26+
"html_url",
27+
"id",
28+
"issue_comment_url",
29+
"issue_events_url",
30+
"issues_url",
31+
"keys_url",
32+
"labels_url",
33+
"languages_url",
34+
"merges_url",
35+
"milestones_url",
36+
"name",
37+
"node_id",
38+
"notifications_url",
39+
"owner",
40+
"private",
41+
"pulls_url",
42+
"releases_url",
43+
"stargazers_url",
44+
"statuses_url",
45+
"subscribers_url",
46+
"subscription_url",
47+
"tags_url",
48+
"teams_url",
49+
"trees_url",
50+
"url"
51+
],
52+
"type": "object",
53+
"properties": {
54+
"archive_url": { "type": "string", "format": "uri-template" },
55+
"assignees_url": { "type": "string", "format": "uri-template" },
56+
"blobs_url": { "type": "string", "format": "uri-template" },
57+
"branches_url": { "type": "string", "format": "uri-template" },
58+
"collaborators_url": { "type": "string", "format": "uri-template" },
59+
"comments_url": { "type": "string", "format": "uri-template" },
60+
"commits_url": { "type": "string", "format": "uri-template" },
61+
"compare_url": { "type": "string", "format": "uri-template" },
62+
"contents_url": { "type": "string", "format": "uri-template" },
63+
"contributors_url": { "type": "string", "format": "uri" },
64+
"deployments_url": { "type": "string", "format": "uri" },
65+
"description": { "type": ["string", "null"] },
66+
"downloads_url": { "type": "string", "format": "uri" },
67+
"events_url": { "type": "string", "format": "uri" },
68+
"fork": { "type": "boolean" },
69+
"forks_url": { "type": "string", "format": "uri" },
70+
"full_name": { "type": "string" },
71+
"git_commits_url": { "type": "string", "format": "uri-template" },
72+
"git_refs_url": { "type": "string", "format": "uri-template" },
73+
"git_tags_url": { "type": "string", "format": "uri-template" },
74+
"hooks_url": { "type": "string", "format": "uri" },
75+
"html_url": { "type": "string", "format": "uri" },
76+
"id": {
77+
"type": "integer",
78+
"description": "Unique identifier of the repository"
79+
},
80+
"issue_comment_url": { "type": "string", "format": "uri-template" },
81+
"issue_events_url": { "type": "string", "format": "uri-template" },
82+
"issues_url": { "type": "string", "format": "uri-template" },
83+
"keys_url": { "type": "string", "format": "uri-template" },
84+
"labels_url": { "type": "string", "format": "uri-template" },
85+
"languages_url": { "type": "string", "format": "uri" },
86+
"merges_url": { "type": "string", "format": "uri" },
87+
"milestones_url": { "type": "string", "format": "uri-template" },
88+
"name": { "type": "string", "description": "The name of the repository." },
89+
"node_id": { "type": "string" },
90+
"notifications_url": { "type": "string", "format": "uri-template" },
91+
"owner": { "$ref": "user.schema.json" },
92+
"private": {
93+
"type": "boolean",
94+
"description": "Whether the repository is private or public."
95+
},
96+
"pulls_url": { "type": "string", "format": "uri-template" },
97+
"releases_url": { "type": "string", "format": "uri-template" },
98+
"stargazers_url": { "type": "string", "format": "uri" },
99+
"statuses_url": { "type": "string", "format": "uri-template" },
100+
"subscribers_url": { "type": "string", "format": "uri" },
101+
"subscription_url": { "type": "string", "format": "uri" },
102+
"tags_url": { "type": "string", "format": "uri" },
103+
"teams_url": { "type": "string", "format": "uri" },
104+
"trees_url": { "type": "string", "format": "uri-template" },
105+
"url": { "type": "string", "format": "uri" }
106+
},
107+
"additionalProperties": false,
108+
"title": "Repository Lite"
109+
}

payload-schemas/schemas/common/workflow-run.schema.json

Lines changed: 4 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -33,110 +33,11 @@
3333
"cancel_url": { "type": "string", "format": "uri" },
3434
"check_suite_url": { "type": "string", "format": "uri" },
3535
"conclusion": { "type": ["string", "null"] },
36-
"created_at": { "type": "string" },
36+
"created_at": { "type": "string", "format": "date-time" },
3737
"event": { "type": "string" },
3838
"head_branch": { "type": "string" },
3939
"head_commit": { "$ref": "commit-simple.schema.json" },
40-
"head_repository": {
41-
"type": "object",
42-
"required": [
43-
"archive_url",
44-
"assignees_url",
45-
"blobs_url",
46-
"branches_url",
47-
"collaborators_url",
48-
"comments_url",
49-
"commits_url",
50-
"compare_url",
51-
"contents_url",
52-
"contributors_url",
53-
"deployments_url",
54-
"description",
55-
"downloads_url",
56-
"events_url",
57-
"fork",
58-
"forks_url",
59-
"full_name",
60-
"git_commits_url",
61-
"git_refs_url",
62-
"git_tags_url",
63-
"hooks_url",
64-
"html_url",
65-
"id",
66-
"issue_comment_url",
67-
"issue_events_url",
68-
"issues_url",
69-
"keys_url",
70-
"labels_url",
71-
"languages_url",
72-
"merges_url",
73-
"milestones_url",
74-
"name",
75-
"node_id",
76-
"notifications_url",
77-
"owner",
78-
"private",
79-
"pulls_url",
80-
"releases_url",
81-
"stargazers_url",
82-
"statuses_url",
83-
"subscribers_url",
84-
"subscription_url",
85-
"tags_url",
86-
"teams_url",
87-
"trees_url",
88-
"url"
89-
],
90-
"properties": {
91-
"archive_url": { "type": "string", "format": "uri-template" },
92-
"assignees_url": { "type": "string", "format": "uri-template" },
93-
"blobs_url": { "type": "string", "format": "uri-template" },
94-
"branches_url": { "type": "string", "format": "uri-template" },
95-
"collaborators_url": { "type": "string", "format": "uri-template" },
96-
"comments_url": { "type": "string", "format": "uri-template" },
97-
"commits_url": { "type": "string", "format": "uri-template" },
98-
"compare_url": { "type": "string", "format": "uri-template" },
99-
"contents_url": { "type": "string", "format": "uri-template" },
100-
"contributors_url": { "type": "string", "format": "uri" },
101-
"deployments_url": { "type": "string", "format": "uri" },
102-
"description": { "type": "string" },
103-
"downloads_url": { "type": "string", "format": "uri" },
104-
"events_url": { "type": "string", "format": "uri" },
105-
"fork": { "type": "boolean" },
106-
"forks_url": { "type": "string", "format": "uri" },
107-
"full_name": { "type": "string" },
108-
"git_commits_url": { "type": "string", "format": "uri-template" },
109-
"git_refs_url": { "type": "string", "format": "uri-template" },
110-
"git_tags_url": { "type": "string", "format": "uri-template" },
111-
"hooks_url": { "type": "string", "format": "uri" },
112-
"html_url": { "type": "string", "format": "uri" },
113-
"id": { "type": "integer" },
114-
"issue_comment_url": { "type": "string", "format": "uri-template" },
115-
"issue_events_url": { "type": "string", "format": "uri-template" },
116-
"issues_url": { "type": "string", "format": "uri-template" },
117-
"keys_url": { "type": "string", "format": "uri-template" },
118-
"labels_url": { "type": "string", "format": "uri-template" },
119-
"languages_url": { "type": "string", "format": "uri" },
120-
"merges_url": { "type": "string", "format": "uri" },
121-
"milestones_url": { "type": "string", "format": "uri-template" },
122-
"name": { "type": "string" },
123-
"node_id": { "type": "string" },
124-
"notifications_url": { "type": "string", "format": "uri-template" },
125-
"owner": { "$ref": "user.schema.json" },
126-
"private": { "type": "boolean" },
127-
"pulls_url": { "type": "string", "format": "uri-template" },
128-
"releases_url": { "type": "string", "format": "uri-template" },
129-
"stargazers_url": { "type": "string", "format": "uri" },
130-
"statuses_url": { "type": "string", "format": "uri-template" },
131-
"subscribers_url": { "type": "string", "format": "uri" },
132-
"subscription_url": { "type": "string", "format": "uri" },
133-
"tags_url": { "type": "string", "format": "uri" },
134-
"teams_url": { "type": "string", "format": "uri" },
135-
"trees_url": { "type": "string", "format": "uri-template" },
136-
"url": { "type": "string", "format": "uri" }
137-
},
138-
"additionalProperties": false
139-
},
40+
"head_repository": { "$ref": "repository-lite.schema.json" },
14041
"head_sha": { "type": "string" },
14142
"html_url": { "type": "string", "format": "uri" },
14243
"id": { "type": "integer" },
@@ -147,119 +48,11 @@
14748
"type": "array",
14849
"items": { "$ref": "pull-request.schema.json" }
14950
},
150-
"repository": {
151-
"type": "object",
152-
"required": [
153-
"archive_url",
154-
"assignees_url",
155-
"blobs_url",
156-
"branches_url",
157-
"collaborators_url",
158-
"comments_url",
159-
"commits_url",
160-
"compare_url",
161-
"contents_url",
162-
"contributors_url",
163-
"deployments_url",
164-
"description",
165-
"downloads_url",
166-
"events_url",
167-
"fork",
168-
"forks_url",
169-
"full_name",
170-
"git_commits_url",
171-
"git_refs_url",
172-
"git_tags_url",
173-
"hooks_url",
174-
"html_url",
175-
"id",
176-
"issue_comment_url",
177-
"issue_events_url",
178-
"issues_url",
179-
"keys_url",
180-
"labels_url",
181-
"languages_url",
182-
"merges_url",
183-
"milestones_url",
184-
"name",
185-
"node_id",
186-
"notifications_url",
187-
"owner",
188-
"private",
189-
"pulls_url",
190-
"releases_url",
191-
"stargazers_url",
192-
"statuses_url",
193-
"subscribers_url",
194-
"subscription_url",
195-
"tags_url",
196-
"teams_url",
197-
"trees_url",
198-
"url"
199-
],
200-
"properties": {
201-
"archive_url": { "type": "string", "format": "uri-template" },
202-
"assignees_url": { "type": "string", "format": "uri-template" },
203-
"blobs_url": { "type": "string", "format": "uri-template" },
204-
"branches_url": { "type": "string", "format": "uri-template" },
205-
"collaborators_url": { "type": "string", "format": "uri-template" },
206-
"comments_url": { "type": "string", "format": "uri-template" },
207-
"commits_url": { "type": "string", "format": "uri-template" },
208-
"compare_url": { "type": "string", "format": "uri-template" },
209-
"contents_url": { "type": "string", "format": "uri-template" },
210-
"contributors_url": { "type": "string", "format": "uri" },
211-
"deployments_url": { "type": "string", "format": "uri" },
212-
"description": { "type": "string" },
213-
"downloads_url": { "type": "string", "format": "uri" },
214-
"events_url": { "type": "string", "format": "uri" },
215-
"fork": { "type": "boolean" },
216-
"forks_url": { "type": "string", "format": "uri" },
217-
"full_name": { "type": "string" },
218-
"git_commits_url": { "type": "string", "format": "uri-template" },
219-
"git_refs_url": { "type": "string", "format": "uri-template" },
220-
"git_tags_url": { "type": "string", "format": "uri-template" },
221-
"hooks_url": { "type": "string", "format": "uri" },
222-
"html_url": { "type": "string", "format": "uri" },
223-
"id": {
224-
"type": "integer",
225-
"description": "Unique identifier of the repository"
226-
},
227-
"issue_comment_url": { "type": "string", "format": "uri-template" },
228-
"issue_events_url": { "type": "string", "format": "uri-template" },
229-
"issues_url": { "type": "string", "format": "uri-template" },
230-
"keys_url": { "type": "string", "format": "uri-template" },
231-
"labels_url": { "type": "string", "format": "uri-template" },
232-
"languages_url": { "type": "string", "format": "uri" },
233-
"merges_url": { "type": "string", "format": "uri" },
234-
"milestones_url": { "type": "string", "format": "uri-template" },
235-
"name": {
236-
"type": "string",
237-
"description": "The name of the repository."
238-
},
239-
"node_id": { "type": "string" },
240-
"notifications_url": { "type": "string", "format": "uri-template" },
241-
"owner": { "$ref": "user.schema.json" },
242-
"private": {
243-
"type": "boolean",
244-
"description": "Whether the repository is private or public."
245-
},
246-
"pulls_url": { "type": "string", "format": "uri-template" },
247-
"releases_url": { "type": "string", "format": "uri-template" },
248-
"stargazers_url": { "type": "string", "format": "uri" },
249-
"statuses_url": { "type": "string", "format": "uri-template" },
250-
"subscribers_url": { "type": "string", "format": "uri" },
251-
"subscription_url": { "type": "string", "format": "uri" },
252-
"tags_url": { "type": "string", "format": "uri" },
253-
"teams_url": { "type": "string", "format": "uri" },
254-
"trees_url": { "type": "string", "format": "uri-template" },
255-
"url": { "type": "string", "format": "uri" }
256-
},
257-
"additionalProperties": false
258-
},
51+
"repository": { "$ref": "repository-lite.schema.json" },
25952
"rerun_url": { "type": "string", "format": "uri" },
26053
"run_number": { "type": "integer" },
26154
"status": { "type": "string" },
262-
"updated_at": { "type": "string" },
55+
"updated_at": { "type": "string", "format": "date-time" },
26356
"url": { "type": "string", "format": "uri" },
26457
"workflow_id": { "type": "integer" },
26558
"workflow_url": { "type": "string", "format": "uri" }

0 commit comments

Comments
 (0)