Skip to content

Commit b80bc76

Browse files
author
Trong Nhan Mai
committed
chore: improve the schema, fix minor issues
1 parent c21d3b0 commit b80bc76

File tree

1 file changed

+72
-8
lines changed

1 file changed

+72
-8
lines changed

tests/integration/cases/micronaut-projects_micronaut-test/report_schema.json

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,81 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "macaron-json-report-schema",
4-
"title": "Report",
4+
"title": "Macaron JSON Report",
5+
"$comment": "For any details about the schema specification and validation documentation, see https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00 and https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00.",
56
"type": "object",
7+
"$defs": {
8+
"wholeNumber": {
9+
"$comment": "A schema that describes whole numbers (positive interger and 0).",
10+
"type": "integer",
11+
"minimum": 0
12+
},
13+
"checkNamePattern": {
14+
"$comment": "The pattern for all Macaron check names. Following ECMA-262 regular expression dialect.",
15+
"pattern": "^mcn_([a-z]+_)+([0-9]+)$",
16+
"type": "string"
17+
},
18+
"checkTree": {
19+
"$comment": "The schema for a check tree. All property names must follow checkNamePattern, and each child instance within this object must follow the checkTree schema recursively.",
20+
"type": "object",
21+
"propertyNames": {
22+
"$ref": "#/$defs/checkNamePattern"
23+
},
24+
"additionalProperties": {
25+
"$ref": "#/$defs/checkTree"
26+
}
27+
}
28+
},
629
"properties": {
730
"metadata": {
8-
"type": "object"
31+
"type": "object",
32+
"properties": {
33+
"timestamps": {
34+
"type": "string"
35+
},
36+
"has_passing_check": {
37+
"type": "boolean"
38+
},
39+
"run_checks": {
40+
"type": "array",
41+
"items": {
42+
"$ref": "#/$defs/checkNamePattern"
43+
}
44+
},
45+
"check_tree": {
46+
"$ref": "#/$defs/checkTree"
47+
}
48+
}
949
},
1050
"target": {
1151
"type": "object",
1252
"properties": {
1353
"info": {
14-
"type": "object"
54+
"type": "object",
55+
"properties": {
56+
"full_name": {
57+
"type": "string"
58+
},
59+
"local_cloned_path": {
60+
"type": "string"
61+
},
62+
"remote_path": {
63+
"type": "string"
64+
},
65+
"branch": {
66+
"$comment": "Follow https://github.com/oracle/macaron/issues/832.",
67+
"oneOf": [
68+
{ "type": "string" },
69+
{ "type": "null" }
70+
]
71+
},
72+
"commit_hash": {
73+
"type": "string"
74+
},
75+
"commit_date": {
76+
"type": "string"
77+
}
78+
}
1579
},
1680
"provenances": {
1781
"type": "object"
@@ -21,8 +85,8 @@
2185
"properties": {
2286
"summary": {
2387
"type": "object",
24-
"items": {
25-
"type": "integer"
88+
"additionalProperties": {
89+
"$ref": "#/$defs/wholeNumber"
2690
}
2791
},
2892
"results": {
@@ -65,10 +129,10 @@
65129
"type": "object",
66130
"properties": {
67131
"analyzed_deps": {
68-
"type": "integer"
132+
"$ref": "#/$defs/wholeNumber"
69133
},
70134
"unique_dep_repos": {
71-
"type": "integer"
135+
"$ref": "#/$defs/wholeNumber"
72136
},
73137
"checks_summary": {
74138
"type": "array",
@@ -79,7 +143,7 @@
79143
"type": "string"
80144
},
81145
"num_deps_pass": {
82-
"type": "integer"
146+
"$ref": "#/$defs/wholeNumber"
83147
}
84148
}
85149
}

0 commit comments

Comments
 (0)