Skip to content

Commit c1c2986

Browse files
committed
docs: add request/response example objects as requested by reviewer
1 parent 5381d1c commit c1c2986

1 file changed

Lines changed: 29 additions & 13 deletions

File tree

backend/routes/authRoutes.js

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,28 @@ const authRoutes = express.Router();
1717
* application/json:
1818
* schema:
1919
* type: object
20-
* required:
21-
* - name
22-
* - email
23-
* - password
20+
* required: [name, email, password]
2421
* properties:
2522
* name:
2623
* type: string
24+
* example: "John Doe"
2725
* email:
2826
* type: string
27+
* example: "john@example.com"
2928
* password:
3029
* type: string
31-
* responses:
32-
* 201:
33-
* description: User registered successfully
30+
* example: "StrongPass123!"
31+
* responses:
32+
* 201:
33+
* description: User registered successfully
34+
* content:
35+
* application/json:
36+
* schema:
37+
* type: object
38+
* properties:
39+
* message:
40+
* type: string
41+
* example: "User registered successfully"
3442
*/
3543
authRoutes.post("/registration", validateRequest(registerSchema), registration);
3644

@@ -46,17 +54,25 @@ authRoutes.post("/registration", validateRequest(registerSchema), registration);
4654
* application/json:
4755
* schema:
4856
* type: object
49-
* required:
50-
* - email
51-
* - password
57+
* required: [email, password]
5258
* properties:
5359
* email:
5460
* type: string
61+
* example: "john@example.com"
5562
* password:
5663
* type: string
57-
* responses:
58-
* 200:
59-
* description: Login successful
64+
* example: "StrongPass123!"
65+
* responses:
66+
* 200:
67+
* description: Login successful
68+
* content:
69+
* application/json:
70+
* schema:
71+
* type: object
72+
* properties:
73+
* token:
74+
* type: string
75+
* example: "eyJhbGciOiJIUzI1Ni..."
6076
*/
6177
authRoutes.post("/login", validateRequest(loginSchema), login);
6278

0 commit comments

Comments
 (0)