Skip to content

Instantly share code, notes, and snippets.

@whs
Created March 7, 2022 14:33
Show Gist options
  • Save whs/78f96431d8ff47df784797105082bcc4 to your computer and use it in GitHub Desktop.
Save whs/78f96431d8ff47df784797105082bcc4 to your computer and use it in GitHub Desktop.
Wise Old Man OpenAPI
{
"openapi": "3.0.0",
"info": {
"title": "Wise Old Man REST API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.wiseoldman.net"
}
],
"paths": {
"/competitions": {
"get": {
"tags": [
"Competitions"
],
"summary": "Search competitions",
"parameters": [
{
"name": "title",
"in": "query",
"description": "A partial title match",
"schema": {
"type": "string"
}
},
{
"name": "metric",
"in": "query",
"description": "The metric to filter the list by",
"schema": {
"$ref": "#/components/schemas/MetricEnum"
}
},
{
"name": "type",
"in": "query",
"description": "The type to filter the list by",
"schema": {
"$ref": "#/components/schemas/CompetitionType"
}
},
{
"name": "status",
"in": "query",
"description": "The status to filter the list by",
"schema": {
"type": "string",
"enum": [
"upcoming",
"ongoing",
"finished"
]
}
},
{
"name": "limit",
"in": "query",
"description": "The maximum amount of results to return",
"schema": {
"type": "integer",
"minimum": 1,
"default": 20
}
},
{
"name": "offset",
"in": "query",
"description": "The amount of results to offset the response by",
"schema": {
"type": "integer",
"minimum": 0,
"default": 0
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Competition"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestError"
}
}
}
}
},
"components": {
"schemas": {
"Competition": {
"type": "object",
"required": [
"id",
"title",
"metric",
"score",
"startsAt",
"endsAt",
"type",
"createdAt",
"updatedAt"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"example": 1
},
"title": {
"type": "string",
"maxLength": 50,
"example": "SOTW 52 - Firemaking"
},
"metric": {
"$ref": "#/components/schemas/MetricEnum"
},
"score": {
"type": "integer",
"default": 0,
"example": 150
},
"startsAt": {
"type": "string",
"format": "date-time",
"example": "2020-03-20T23:00:00.000Z"
},
"endsAt": {
"type": "string",
"format": "date-time",
"example": "2020-04-16T23:00:00.000Z"
},
"type": {
"$ref": "#/components/schemas/CompetitionType"
},
"groupId": {
"type": "integer"
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2020-04-03T23:00:27.184Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"example": "2020-04-03T23:48:03.502Z"
},
"participantCount": {
"type": "number",
"minimum": 0,
"example": 21
},
"duration": {
"type": "string",
"example": "27 days"
}
}
},
"CompetitionType": {
"type": "string",
"enum": [
"classic",
"team"
]
},
"MetricEnum": {
"type": "string",
"enum": [
"overall",
"attack",
"defence",
"strength",
"hitpoints",
"ranged",
"prayer",
"magic",
"cooking",
"woodcutting",
"fletching",
"fishing",
"firemaking",
"crafting",
"smithing",
"mining",
"herblore",
"agility",
"thieving",
"slayer",
"farming",
"runecrafting",
"hunter",
"construction",
"league_points",
"bounty_hunter_hunter",
"bounty_hunter_rogue",
"clue_scrolls_all",
"clue_scrolls_beginner",
"clue_scrolls_easy",
"clue_scrolls_medium",
"clue_scrolls_hard",
"clue_scrolls_elite",
"clue_scrolls_master",
"last_man_standing",
"soul_wars_zeal",
"abyssal_sire",
"alchemical_hydra",
"barrows_chests",
"bryophyta",
"callisto",
"cerberus",
"chambers_of_xeric",
"chambers_of_xeric_challenge_mode",
"chaos_elemental",
"chaos_fanatic",
"commander_zilyana",
"corporeal_beast",
"crazy_archaeologist",
"dagannoth_prime",
"dagannoth_rex",
"dagannoth_supreme",
"deranged_archaeologist",
"general_graardor",
"giant_mole",
"grotesque_guardians",
"hespori",
"kalphite_queen",
"king_black_dragon",
"kraken",
"kreearra",
"kril_tsutsaroth",
"mimic",
"nex",
"nightmare",
"phosanis_nightmare",
"obor",
"sarachnis",
"scorpia",
"skotizo",
"tempoross",
"the_gauntlet",
"the_corrupted_gauntlet",
"theatre_of_blood",
"theatre_of_blood_hard_mode",
"thermonuclear_smoke_devil",
"tzkal_zuk",
"tztok_jad",
"venenatis",
"vetion",
"vorkath",
"wintertodt",
"zalcano",
"zulrah",
"ehp",
"ehb"
]
}
},
"responses": {
"BadRequestError": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"message",
"name",
"statusCode"
],
"properties": {
"message": {
"type": "string",
"example": "Parameter 'example' is undefined"
},
"name": {
"type": "string",
"example": "BadRequestError"
},
"statusCode": {
"type": "integer",
"example": 400
},
"data": {}
}
}
}
}
}
}
},
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment