-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create schema.json * add workflow * update workflow * fix typo
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Validate JSON | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install AJV CLI | ||
run: npm install -g ajv-cli | ||
|
||
- name: Validate rewards.json | ||
run: ajv validate -s schema_rewards.json -d './rewards.json' --strict=false | ||
|
||
- name: Validate epochs.json | ||
run: ajv validate -s schema_epochs.json -d './epochs.json' --strict=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"epoch": { "type": "integer", "minimum": 1 }, | ||
"start": { "type": "string", "format": "date-time" }, | ||
"end": { "type": "string", "format": "date-time" } | ||
}, | ||
"required": ["epoch", "start", "end"], | ||
"additionalProperties": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"epoch": { "type": "number" }, | ||
"chain": { "type": "string", "enum": ["Avax", "Arbitrum", "BNB"] }, | ||
"poolId": { "type": "string", "pattern": "^\\S*$" }, | ||
"rewardPerDay": { "type": "number" }, | ||
"rewardToken": { "type": "string", "pattern": "^\\S*$" } | ||
}, | ||
"required": ["epoch", "chain", "poolId", "rewardPerDay", "rewardToken"], | ||
"additionalProperties": false | ||
} | ||
} |