Skip to content

Commit

Permalink
Schema and definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Aug 23, 2023
1 parent 89a1a42 commit abc0a3b
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 0 deletions.
42 changes: 42 additions & 0 deletions definitions/12-Hiro-Event-Leaderboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"event_leaderboards": {
"event1": {
"name": "event name",
"description": "event description",
"category": "some category",
"ascending": false,
"operator": "best",
"reset_schedule": "0 0 * * *",
"cohort_size": 100,
"additional_properties": {
"key": "value"
},
"max_num_score": 0,
"tiers": 5,
"max_idle_tier_drop": 1,
"start_time_sec": 0,
"end_time_sec": 0,
"duration": 86400,
"reward_tiers": [
{
"rank_min": 1,
"rank_max": 10,
"tier_change": 1,
"reward": {}
},
{
"rank_min": 11,
"rank_max": 90,
"tier_change": 0,
"reward": {}
},
{
"rank_min": 91,
"rank_max": 100,
"tier_change": -1,
"reward": {}
}
]
}
}
}
125 changes: 125 additions & 0 deletions schemas/12-Hiro-Event-Leaderboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"event_leaderboards": {
"type": "object",
"title": "event_leaderboards",
"patternProperties": {
".{1,}": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "name",
"pattern": ".{1,}"
},
"description": {
"type": "string",
"title": "description",
"pattern": ".{1,}"
},
"category": {
"type": "string",
"title": "category",
"pattern": ".{1,}"
},
"ascending": {
"type": "boolean",
"title": "ascending"
},
"operator": {
"type": "string",
"title": "operator",
"enum": [
"best",
"set",
"incr",
"decr",
"increment",
"decrement"
]
},
"reset_schedule": {
"type": "string",
"title": "reset_schedule"
},
"cohort_size": {
"type": "number",
"title": "cohort_size",
"minimum": 1
},
"additional_properties": {
"type": "object",
"title": "additional_properties",
"patternProperties": {
".{1,}": {
"type": "string"
}
}
},
"max_num_score": {
"type": "number",
"title": "max_num_score",
"minimum": 0
},
"tiers": {
"type": "number",
"title": "tiers",
"minimum": 1
},
"max_idle_tier_drop": {
"type": "number",
"title": "max_idle_tier_drop",
"minimum": 0
},
"start_time_sec": {
"type": "number",
"title": "start_time_sec",
"minimum": 0
},
"end_time_sec": {
"type": "number",
"title": "end_time_sec",
"minimum": 0
},
"duration": {
"type": "number",
"title": "duration",
"minimum": 0
},
"reward_tiers": {
"type": "array",
"title": "reward_tiers",
"items": {
"type": "object",
"properties": {
"rank_min": {
"type": "number",
"title": "rank_min",
"minimum": 0
},
"rank_max": {
"type": "number",
"title": "rank_max",
"minimum": 0
},
"tier_change": {
"type": "number",
"title": "tier_change",
"minimum": 0
},
"reward": {
"title": "reward",
"$ref": "Hiro-Rewards"
}
}
}
}
}
}
}
}
},
"required": ["event_leaderboards"],
"type": "object"
}

0 comments on commit abc0a3b

Please sign in to comment.