Skip to content

Commit

Permalink
fix: docs user by id
Browse files Browse the repository at this point in the history
  • Loading branch information
muritadb committed Sep 19, 2024
1 parent a13d7eb commit acc0d91
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 4 deletions.
38 changes: 35 additions & 3 deletions swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,6 @@ const docTemplate = `{
"/user/login": {
"post": {
"description": "Logs in a user and returns a JWT token",
"/user/{userID}": {
"get": {
"description": "Retrieves User details based on the User ID provided as a parameter.",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -391,6 +388,41 @@ const docTemplate = `{
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/user/{userID}": {
"get": {
"description": "Retrieves User details based on the User ID provided as a parameter.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Find User by ID",
"parameters": [
{
"type": "string",
"description": "ID of the User to be retrieved",
"name": "userID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
Expand Down
84 changes: 84 additions & 0 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,90 @@
}
}
},
"/user/login": {
"post": {
"description": "Logs in a user and returns a JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "User login",
"parameters": [
{
"description": "User login information",
"name": "userLoginDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UserLoginDto"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/user/{provider}/login": {
"post": {
"description": "Logs in a user using a specified provider (SSO) and returns a JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "User login with provider",
"parameters": [
{
"type": "string",
"description": "The provider for Single Sign-On (e.g., google, facebook)",
"name": "provider",
"in": "path",
"required": true
},
{
"description": "User login information with SSO",
"name": "UserSSODto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UserSSODto"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/user/{userID}": {
"get": {
"description": "Retrieves User details based on the User ID provided as a parameter.",
Expand Down
13 changes: 12 additions & 1 deletion swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,18 @@ paths:
required: true
schema:
$ref: '#/definitions/dto.UserSSODto'
produces:
- application/json
responses:
"200":
description: OK
"400":
description: Bad Request
"500":
description: Internal Server Error
summary: User login with provider
tags:
- User
/user/{userID}:
get:
consumes:
Expand All @@ -561,7 +573,6 @@ paths:
description: Bad Request
"500":
description: Internal Server Error
summary: User login with provider
summary: Find User by ID
tags:
- User
Expand Down

0 comments on commit acc0d91

Please sign in to comment.