Skip to content
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

Provided some examples into the OpenAPI spec #19

Merged
merged 1 commit into from
Mar 17, 2024
Merged
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
36 changes: 35 additions & 1 deletion gatewayservice/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,37 @@ paths:
username:
type: string
description: User ID.
example: student
password:
type: string
description: User password.
example: pass
responses:
'200':
description: User added successfully.
content:
application/json:
schema:
type: object
properties:
username:
type: string
description: User ID
password:
type: string
description: Hashed password
example: $2b$10$ZKdNYLWFQxzt5Rei/YTc/OsZNi12YiWz30JeUFHNdAt7MyfmkTuvC
_id:
type: string
description: Identification
example: 65f756db3fa22d227a4b7c7d
createdAt:
type: string
description: Creation date.
example: '2024-03-17T20:47:23.935Z'
___v:
type: integer
example: '0'
'400':
description: Failed to add user.
content:
Expand All @@ -39,6 +64,7 @@ paths:
error:
type: string
description: Error information.
example: getaddrinfo EAI_AGAIN mongodb
/health:
get:
summary: Check the health status of the service.
Expand All @@ -54,6 +80,7 @@ paths:
status:
type: string
description: Health status.
example: OK
/login:
post:
summary: Log in to the system.
Expand All @@ -68,9 +95,11 @@ paths:
username:
type: string
description: User ID.
example: student
password:
type: string
description: User password.
example: pass
responses:
'200':
description: Login successful. Returns user token, username, and creation date.
Expand All @@ -82,12 +111,15 @@ paths:
token:
type: string
description: User token.
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NWY3NTZkYjNmYTIyZDIyN2E0YjdjN2QiLCJpYXQiOjE3MTA3MDg3NDUsImV4cCI6MTcxMDcxMjM0NX0.VMG_5DOyQ4GYlJQRcu1I6ICG1IGzuo2Xuei093ONHxw
username:
type: string
description: Username.
example: student
createdAt:
type: string
description: Creation date.
example: '2024-03-17T20:47:23.935Z'
'401':
description: Invalid credentials.
content:
Expand All @@ -97,7 +129,8 @@ paths:
properties:
error:
type: string
description: Invalid Credentials.
description: Shows the error info..
example: Invalid credentials
'500':
description: Internal server error.
content:
Expand All @@ -108,3 +141,4 @@ paths:
error:
type: string
description: Error information.
example: Internal Server Error