added paths to openapi

This commit is contained in:
2023-03-01 14:03:36 +01:00
parent eb0a6a4062
commit 851d75c81a
+14 -65
View File
@@ -7,16 +7,15 @@ info:
servers: servers:
- url: 'http://localhost:3000' - url: 'http://localhost:3000'
paths: paths:
'/users/{userId}': '/players/id/{id}':
parameters: parameters:
- schema: - schema:
type: integer type: string
name: userId name: id
in: path in: path
required: true required: true
description: Id of an existing user.
get: get:
summary: Get User Info by User ID summary: Get Player by Username
tags: [] tags: []
responses: responses:
'200': '200':
@@ -24,7 +23,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/User' $ref: '#/components/schemas/Player'
examples: examples:
Get User Alice Smith: Get User Alice Smith:
value: value:
@@ -37,60 +36,8 @@ paths:
signUpDate: '2019-08-24' signUpDate: '2019-08-24'
'404': '404':
description: User Not Found description: User Not Found
operationId: get-users-userId operationId: get-player-by-id
description: Retrieve the information of the user with the matching user ID. description: Retrieve the information of the player with the matching id
patch:
summary: Update User Information
operationId: patch-users-userId
responses:
'200':
description: User Updated
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
Updated User Rebecca Baker:
value:
id: 13
firstName: Rebecca
lastName: Baker
email: rebecca@gmail.com
dateOfBirth: '1985-10-02'
emailVerified: false
createDate: '2019-08-24'
'404':
description: User Not Found
'409':
description: Email Already Taken
description: Update the information of an existing user.
requestBody:
content:
application/json:
schema:
type: object
properties:
firstName:
type: string
lastName:
type: string
email:
type: string
description: 'If a new email is given, the user''s email verified property will be set to false.'
dateOfBirth:
type: string
examples:
Update First Name:
value:
firstName: Rebecca
Update Email:
value:
email: rebecca@gmail.com
Update Last Name & Date of Birth:
value:
lastName: Baker
dateOfBirth: '1985-10-02'
description: Patch user properties to update.
/user: /user:
post: post:
summary: Create New User summary: Create New User
@@ -155,7 +102,7 @@ components:
examples: [] examples: []
properties: properties:
id: id:
$ref: '#/components/schemas/EntityID' $ref: '#/components/schemas/PlayerID'
description: Unique identifier for the given user. description: Unique identifier for the given user.
name: name:
type: string type: string
@@ -218,11 +165,13 @@ components:
type: string type: string
example: fvnkhead's 7v7 example: fvnkhead's 7v7
attacker: attacker:
$ref: '#/components/schemas/EntityID' $ref: '#/components/schemas/PlayerID'
attacker_type:
type: string
attacker_weapon: attacker_weapon:
$ref: '#/components/schemas/WeaponID' $ref: '#/components/schemas/WeaponID'
victim: victim:
$ref: '#/components/schemas/EntityID' $ref: '#/components/schemas/PlayerID'
victim_weapon: victim_weapon:
$ref: '#/components/schemas/WeaponID' $ref: '#/components/schemas/WeaponID'
map: map:
@@ -236,9 +185,9 @@ components:
readOnly: true readOnly: true
required: required:
- server - server
- attacker - attacker_type
- victim - victim
EntityID: PlayerID:
title: EntityID title: EntityID
x-stoplight: x-stoplight:
id: 9icavmq5bgsqp id: 9icavmq5bgsqp