Skip to content

add swagger user docs #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions server/docs/schemas/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -477,28 +477,9 @@
"tags": [
"Auth"
],
"description": "Register a new user",
"description": "Register/Signup a new user",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
]
}
}
}
"$ref": "#/components/requestBodies/Auth"
},
"responses": {
"200": {
Expand Down Expand Up @@ -721,6 +702,31 @@
}
}
}
},
"requestBodies": {
"Auth": {
"description": "Signup, login",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
]
}
}
}
}
}
}
}
18 changes: 18 additions & 0 deletions server/docs/user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
components:
schemas:
requestBodies:
Auth:
description: Signup, login
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
required:
- email
- password
16 changes: 2 additions & 14 deletions server/src/routes/user.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,9 @@ const {postSignup, postLogin} = require('../controllers/user.controller');
* post:
* tags:
* - Auth
* description: Register a new user
* description: Register/Signup a new user
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* email:
* type: string
* password:
* type: string
* required:
* - email
* - password
* $ref: '#/components/requestBodies/Auth'
* responses:
* 200:
* description: Signup successful
Expand Down