Skip to content

Commit e72f400

Browse files
committed
Validate JSON
1 parent 2290ac2 commit e72f400

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Validate JSON
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'Pagetual/pagetualRules.json'
7+
8+
jobs:
9+
validate-json:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: json-yaml-validate
16+
uses: GrantBirki/json-yaml-validate@v3.0.0
17+
id: json-yaml-validate
18+
with:
19+
json_schema: Pagetual/pagetual.schema.json
20+
files: |
21+
Pagetual/pagetualRules.json

Pagetual/pagetual.schema.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Sites data",
3+
"description": "Object containing site config",
4+
"type": "array",
5+
"items": {
6+
"type": "object",
7+
"properties": {
8+
"name": {
9+
"title": "Site Name",
10+
"description": "The site's name.",
11+
"examples": [
12+
"Google"
13+
],
14+
"type": "string"
15+
},
16+
"url": {
17+
"title": "Site Url",
18+
"description": "The Regexp of site's url.",
19+
"examples": [
20+
"^https:\/\/google\\.com\/"
21+
],
22+
"type": "string"
23+
}
24+
},
25+
"required": ["name", "url"]
26+
}
27+
}

0 commit comments

Comments
 (0)