Skip to content

Commit 99ac727

Browse files
committed
Started working on OpenAPI 3 doc
1 parent 52ac09b commit 99ac727

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## API Docs:
2+
3+
```
4+
docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.yaml -v app:/foo swaggerapi/swagger-ui
5+
```

swagger.yaml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
openapi: 3.0.0
2+
info:
3+
description: "This is the Matcha API documentation"
4+
version: 0.0.0
5+
title: Matcha API
6+
termsOfService: https://github.com/Seluj78/PyMatcha/blob/dev/LICENSE
7+
contact:
8+
email: jlasne@student.42.fr
9+
license:
10+
name: GNU GPL 3
11+
url: https://github.com/Seluj78/PyMatcha/blob/dev/LICENSE
12+
13+
# TODO: Email and password once rewritten with new frontend
14+
# TODO: https://swagger.io/docs/specification/links/
15+
16+
tags:
17+
- name: Authentication
18+
description: Login and register routes
19+
- name: Complete Profile
20+
- name: Edit Profile
21+
- name: Report Profile
22+
- name: View Profile
23+
24+
- name: Like
25+
description: Like, unlike user etc...
26+
- name: Match
27+
- name: Messages
28+
description: Send and receive messages
29+
- name: Recommendations
30+
- name: User
31+
description: Get user info
32+
- name: Debug
33+
description: Debug routes
34+
35+
paths:
36+
/auth/register:
37+
post:
38+
tags:
39+
- Authentication
40+
summary: Register a new user to Matcha
41+
description: ""
42+
operationId: registerUser
43+
# security:
44+
# - bearerAuth: []
45+
requestBody:
46+
description: Parameters to create a user
47+
required: true
48+
content:
49+
application/json:
50+
schema:
51+
$ref: '#/components/schemas/CreateUser'
52+
responses:
53+
"200":
54+
description: User successfully created
55+
content:
56+
application/json:
57+
schema:
58+
type: object
59+
properties:
60+
success:
61+
type: boolean
62+
description: If the request is a success
63+
example: true
64+
status_code:
65+
type: integer
66+
description: The status code
67+
example: 200
68+
email:
69+
type: string
70+
description: The user email
71+
example: foo@example.org
72+
"409":
73+
$ref: '#/components/responses/Conflict'
74+
75+
servers:
76+
- url: https://api.matcha.com
77+
78+
components:
79+
responses:
80+
Conflict:
81+
description: Conflict error
82+
content:
83+
application/json:
84+
schema:
85+
type: object
86+
properties:
87+
code:
88+
type: string
89+
example: 409
90+
default: 409
91+
success:
92+
type: boolean
93+
default: false
94+
example: false
95+
error:
96+
type: object
97+
properties:
98+
type:
99+
type: string
100+
default: ConflictError
101+
example: ConflictError
102+
name:
103+
type: string
104+
default: Conflict Error
105+
example: Conflict Error
106+
message:
107+
type: string
108+
solution:
109+
type: string
110+
securitySchemes:
111+
bearerAuth:
112+
type: http
113+
scheme: bearer
114+
bearerFormat: JWT
115+
schemas:
116+
CreateUser:
117+
type: object
118+
properties:
119+
username:
120+
type: string
121+
example: foobar
122+
email:
123+
type: string
124+
example: foo@example.org
125+
password:
126+
type: string
127+
example: dolphin2
128+
first_name:
129+
type: string
130+
example: Foo
131+
last_name:
132+
type: string
133+
example: Bar

0 commit comments

Comments
 (0)