source: TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/RegisterUser.openapi.yaml@ 462

Last change on this file since 462 was 462, checked in by alloc, 15 months ago

More OpenAPI specs added

File size: 3.2 KB
Line 
1openapi: 3.1.0
2info:
3 title: Register User
4 version: '1'
5
6components:
7 schemas:
8 TypeRegisterUserName:
9 type: string
10
11 RegisterUserElement:
12 type: object
13 properties:
14 playerName:
15 type: string
16 description: In-game user name who requested the registration
17 expirationSeconds:
18 type: number
19 format: double
20 description: Time until the registration token expires
21 required:
22 - playerName
23 - expirationSeconds
24
25
26 requestBodies:
27 RegisterUserBodyIn:
28 content:
29 application/json:
30 schema:
31 type: object
32 properties:
33 token:
34 type: string
35 format: password
36 username:
37 type: string
38 password:
39 type: string
40 format: password
41 required:
42 - token
43 - username
44 - password
45 required: true
46
47
48 parameters:
49 RegisterUserTokenPathParameter:
50 name: token
51 in: path
52 required: true
53 schema:
54 $ref: '#/components/schemas/TypeRegisterUserName'
55
56
57paths:
58 /api/registeruser:
59 post:
60 tags:
61 - Permissions
62 summary: Register user submit
63 description: Finish user registration process
64 operationId: RegisterUser.post
65 requestBody:
66 $ref: '#/components/requestBodies/RegisterUserBodyIn'
67 responses:
68 201:
69 description: User created or updated
70 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
71 400:
72 description: Invalid request body, errorCode will be one of 'MISSING_TOKEN', 'MISSING_USERNAME' or 'MISSING_PASSWORD'
73 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
74 401:
75 description: Can not proceed due to invalid data, errorCode will be one of 'INVALID_OR_EXPIRED_TOKEN', 'INVALID_USERNAME', 'INVALID_PASSWORD' or 'DUPLICATE_USERNAME'
76 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
77
78
79 /api/registeruser/{token}:
80 get:
81 tags:
82 - Permissions
83 summary: Register user get data
84 description: Get data for user registration
85 operationId: RegisterUser.get.id
86 parameters:
87 - $ref: '#/components/parameters/RegisterUserTokenPathParameter'
88 responses:
89 200:
90 description: User registration data
91 content:
92 application/json:
93 schema:
94 type: object
95 properties:
96 data:
97 $ref: '#/components/schemas/RegisterUserElement'
98 meta:
99 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
100 required:
101 - data
102 - meta
103 400:
104 description: Invalid request, errorCode will be 'NO_TOKEN'
105 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
106 404:
107 description: Token not found
108 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
Note: See TracBrowser for help on using the repository browser.