api reference v0.1

This commit is contained in:
2023-03-01 19:08:03 +01:00
parent 236040376a
commit 6ed3b19a9f
+272 -81
View File
@@ -9,7 +9,7 @@ servers:
paths: paths:
/weapons/: /weapons/:
get: get:
summary: Your GET endpoint summary: List Weapons
tags: [] tags: []
responses: responses:
'200': '200':
@@ -20,11 +20,11 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/Weapon' $ref: '#/components/schemas/Weapon'
operationId: get-weapons operationId: get-weapon-list
description: '' description: ''
/maps/: /maps/:
get: get:
summary: Your GET endpoint summary: List Maps
tags: [] tags: []
responses: responses:
'200': '200':
@@ -35,59 +35,34 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/Map' $ref: '#/components/schemas/Map'
operationId: get-maps operationId: get-map-list
'/players/id/{id}': /players:
get:
summary: List Players
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Player'
operationId: get-player-list
'/players/{playerId}':
parameters: parameters:
- schema: - $ref: '#/components/parameters/playerId'
type: string
name: id
in: path
required: true
get: get:
summary: Get Player by Username summary: Get Player by Username
tags: [] tags: []
responses: responses:
'200': '200':
description: Player Found $ref: '#/components/responses/Player-report'
content:
application/json:
schema:
$ref: '#/components/schemas/Player'
examples:
Get User Alice Smith:
value:
id: 142
firstName: Alice
lastName: Smith
email: alice.smith@gmail.com
dateOfBirth: '1997-10-31'
emailVerified: true
signUpDate: '2019-08-24'
'404': '404':
description: User Not Found description: User Not Found
operationId: get-player-by-id operationId: get-player-report
description: Retrieve the information of the player with the matching id description: Retrieve the information of the player with the matching id
'/players/name/{name}':
parameters:
- schema:
type: string
name: name
in: path
required: true
get:
summary: Get Player by ID
tags: []
responses:
'200':
description: Player Found
content:
application/json:
schema:
$ref: '#/components/schemas/Player'
'404':
description: Player Not Found
operationId: get-player-by-name
description: ''
/servers/: /servers/:
get: get:
summary: Get Server list summary: Get Server list
@@ -101,20 +76,32 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/Server' $ref: '#/components/schemas/Server'
operationId: get-servers operationId: get-server-list
'/servers/{serverId}': '/servers/{serverId}':
parameters: parameters:
- name: serverId - $ref: '#/components/parameters/serverId'
in: path
required: true
schema:
type: string
get: get:
summary: Get Server report summary: Get Server report
operationId: get-server-player-report operationId: get-server-report
responses:
'200':
$ref: '#/components/responses/Server-report'
'/server/{serverId}/players':
get:
summary: List Players
tags: []
responses: responses:
'200': '200':
description: OK description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Player'
operationId: get-player-list-for-server
parameters:
- $ref: '#/components/parameters/serverId'
'/servers/{serverId}/kills': '/servers/{serverId}/kills':
post: post:
summary: Post kills summary: Post kills
@@ -142,11 +129,24 @@ paths:
summary: Get Weapon report for server summary: Get Weapon report for server
tags: [] tags: []
responses: {} responses: {}
operationId: get-server-weapons-report operationId: get-weapons-report-for-server
parameters: [] parameters: []
x-internal: false x-internal: false
parameters: parameters:
- $ref: '#/components/parameters/serverId' - $ref: '#/components/parameters/serverId'
'/servers/{serverId}/players/{playerId}':
parameters:
- $ref: '#/components/parameters/playerId'
- $ref: '#/components/parameters/serverId'
get:
summary: Get Player report for Server
tags: []
responses:
'200':
$ref: '#/components/responses/Player-server-report'
'404':
description: Not Found
operationId: get-player-on-server
components: components:
schemas: schemas:
Player: Player:
@@ -158,10 +158,18 @@ components:
properties: properties:
id: id:
$ref: '#/components/schemas/PlayerID' $ref: '#/components/schemas/PlayerID'
description: Unique identifier for the given user. description: Player Origin ID
name: name:
type: string type: string
example: Legonzaur example: Legonzaur
opt-out:
type: boolean
default: false
description: 'If set to true, kill and deaths about this user won''t be sent to the database'
hide_TOS:
type: boolean
default: false
description: 'If set to true, TOS will be hidden when player joins a server'
required: required:
- id - id
Weapon: Weapon:
@@ -206,6 +214,7 @@ components:
image: image:
type: string type: string
format: uri format: uri
example: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
required: required:
- id - id
- internal - internal
@@ -217,10 +226,10 @@ components:
properties: properties:
id: id:
type: string type: string
token: example: '1'
type: string
name: name:
type: string type: string
example: fvnknoots 7v7
Kill: Kill:
title: Kill title: Kill
x-stoplight: x-stoplight:
@@ -298,6 +307,56 @@ components:
x-stoplight: x-stoplight:
id: zoazw8eoi7qwr id: zoazw8eoi7qwr
type: integer type: integer
PrefferredServer:
title: PrefferredServer
x-stoplight:
id: xok1i1668gx6o
type: object
properties:
server:
$ref: '#/components/schemas/Server'
killCount:
type: integer
example: 4988
deathCount:
type: integer
example: 4671
PrefferedWeapon:
title: PrefferedWeapon
x-stoplight:
id: b52mxxdsbv1wx
type: object
properties:
weapon:
$ref: '#/components/schemas/Weapon'
killCount:
type: integer
deathCount:
type: integer
PrefferedMap:
title: PrefferedMap
x-stoplight:
id: 17kjfi5wu6f4h
type: object
properties:
map:
$ref: '#/components/schemas/Map'
killCount:
type: integer
deathCount:
type: integer
TopPlayers:
title: TopPlayers
x-stoplight:
id: rsl4jqpvwunah
type: object
properties:
player:
$ref: '#/components/schemas/Player'
kill_count:
type: integer
death_count:
type: integer
securitySchemes: securitySchemes:
server_token: server_token:
name: API Key name: API Key
@@ -319,23 +378,12 @@ components:
type: string type: string
responses: responses:
Server-report: Server-report:
description: Example response description: OK
content: content:
application/json: application/json:
schema: schema:
type: object type: object
properties: properties:
id:
type: string
Player-server-report:
description: Example response
content:
application/json:
schema:
type: object
properties:
player:
$ref: '#/components/schemas/Player'
server: server:
$ref: '#/components/schemas/Server' $ref: '#/components/schemas/Server'
total_kills: total_kills:
@@ -347,23 +395,166 @@ components:
type: string type: string
format: date-time format: date-time
most_used_weapons: most_used_weapons:
type:
- array
maxItems: 5
items:
type: object
additionalProperties: false
preferred_maps:
type: array type: array
items: items:
type: object $ref: '#/components/schemas/PrefferedWeapon'
examples: {} preffered_maps:
Player-report: type: array
description: Example response items:
$ref: '#/components/schemas/PrefferedMap'
top_players:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/TopPlayers'
Player-server-report:
description: OK
content: content:
application/json: application/json:
schema: schema:
type: object type: object
properties: properties:
player: player:
$ref: '#/components/schemas/Player'
server:
$ref: '#/components/schemas/Server'
total_kills:
type: integer
description: Number of kills of the user in this server
total_deaths:
type: integer
description: Number of deaths of the user in this server
first_record:
type: string type: string
format: date-time
last_record:
type: string
format: date-time
most_used_weapons:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedWeapon'
preferred_maps:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedMap'
furthest_kill_distance:
type: number
average_kill_distance:
type: number
examples:
Example 1:
value:
player:
id: 0
name: Legonzaur
opt-out: false
hide_TOS: false
server:
id: '1'
name: fvnknoots 7v7
total_kills: 9865
total_deaths: 9954
first_record: '2019-08-24T14:15:22Z'
last_record: '2019-08-24T14:15:22Z'
most_used_weapons:
- weapon:
id: 0
internal: mp_weapon_sniper
name: Kraber
description: string
image: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png'
killCount: 0
deathCount: 0
preferred_maps:
- map:
id: 0
internal: mp_angel_city
name: Angel City
description: string
image: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
killCount: 0
deathCount: 0
furthest_kill_distance: 0
average_kill_distance: 0
Player-report:
description: OK
content:
application/json:
schema:
type: object
properties:
player:
$ref: '#/components/schemas/Player'
preferred_servers:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferredServer'
total_kills:
type: integer
description: Number of kills of the user in the entire database
total_deaths:
type: integer
description: Number of kills of the user in the entire database
first_record:
type: string
format: date-time
last_record:
type: string
format: date-time
most_used_weapons:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedWeapon'
preferred_maps:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedMap'
furthest_kill_distance:
type: number
average_kill_distance:
type: number
examples:
Example 1:
value:
player:
id: 0
name: Legonzaur
opt-out: false
hide_TOS: false
preferred_servers:
- server:
id: '1'
name: fvnknoots 7v7
killCount: 4988
deathCount: 4671
total_kills: 0
total_deaths: 0
first_record: '2019-08-24T14:15:22Z'
last_record: '2019-08-24T14:15:22Z'
most_used_weapons:
- weapon:
id: 0
internal: mp_weapon_sniper
name: Kraber
description: string
image: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png'
killCount: 0
deathCount: 0
preferred_maps:
- map:
id: 0
internal: mp_angel_city
name: Angel City
description: string
image: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
killCount: 0
deathCount: 0
furthest_kill_distance: 0
average_kill_distance: 0
examples: {}