-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
151 lines (151 loc) · 3.74 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
openapi: 3.1.0
info:
title: Scribe REST API
description: |
This API allows writing down marks on a Tic Tac Toe board
and requesting the state of the board or of individual squares.
version: 0.0.1
paths:
/api/register:
post:
summary: Register
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
$ref: "#/components/schemas/name"
email:
$ref: "#/components/schemas/email"
password:
type: string
password_confirmation:
type: string
responses:
201:
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/token_response"
/api/login:
post:
summary: Login
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
$ref: "#/components/schemas/name"
email:
$ref: "#/components/schemas/email"
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/token_response"
/api/user:
get:
summary: Get auth user
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/user"
/api/posts:
get:
summary: All user posts
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/post"
post:
summary: Create post
requestBody:
content:
application/json:
schema:
type: object
properties:
text_content:
type: string
responses:
201:
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/post"
components:
schemas:
id:
type: integer
minimum: 1
example: 342
name:
type: string
description: Full name
example: John
email:
type: string
example: john@example.com
access_token:
type: string
example: 1|nywRLBmtwekJC96faiggewR2nJPqcC5QGY7VKShi
token_type:
type: string
example: Bearer
token_response:
type: object
properties:
access_token:
$ref: "#/components/schemas/access_token"
token_type:
$ref: "#/components/schemas/token_type"
date:
type: string
example: "2023-08-13T12:44:23.000000Z"
user:
type: object
properties:
id:
$ref: "#/components/schemas/id"
name:
$ref: "#/components/schemas/name"
email:
$ref: "#/components/schemas/email"
email_verified_at:
$ref: "#/components/schemas/date"
created_at:
$ref: "#/components/schemas/date"
updated_at:
$ref: "#/components/schemas/date"
post:
type: object
properties:
uuid:
type: string
example: '99e17860-bd24-40f5-a55a-151674ba30f6'
user_id:
$ref: '#/components/schemas/id'
text_content:
type: string
created_at:
$ref: "#/components/schemas/date"
updated_at:
$ref: "#/components/schemas/date"
user:
$ref: "#/components/schemas/user"