💥

유저 정보 update

URL
/user/my
유저
method
PUT
업데이트 시 필드를 비워두면 업데이트를 안하도록 했음.
근데 한 줄 소개 항목을 만약 비우고 싶다면 공백을 보낼 것.

Request Headers

Header
Type
Description
Authorization
String
Bearer {JWT_ACCESS_TOKEN}

Request Body

Field
Type
Required
Constraints
Description
nickname
String
No
Max length: 30
The new nickname of the user.
profileImage
String
No
Max length: 255
The URL of the new profile image.
description
String
No
Max length: 50
The new description of the user.
Example Request
PUT /my HTTP/1.1 Host: api.yourdomain.com Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... Content-Type: application/json { "nickname": "new_nickname", "profileImage": "https://example.com/new-image.png", "description": "Updated description of the user" }
Plain Text
복사

Response

Field
Type
Description
nickname
String
The updated nickname of the user.
description
String
The updated description of the user.
univName
String
The university name of the user.
profileImage
String
The URL of the updated profile image.
Example Response (200 OK)
{ "nickname": "new_nickname", "description": "Updated description of the user", "univName": "Example University", "profileImage": "https://example.com/new-image.png" }
JSON
복사

Error Responses

400 Bad Request: When the request body fails validation (e.g., fields exceed max length or contain invalid characters).
{ "status": 400, "error": "Bad Request", "message": "Validation failed for object='updateRequest'. Field error in object 'updateRequest' on field 'nickname': rejected value [nickname_too_long]; codes [Size.updateRequest.nickname,Size.nickname,Size.java.lang.String,Size]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [updateRequest.nickname,nickname]; arguments []; default message [nickname],30,1]; default message [size must be between 1 and 30]" }
JSON
복사
401 Unauthorized: When the JWT token is missing, invalid, or expired.
{ "status": 401, "error": "Unauthorized", "message": "Invalid JWT token." }
JSON
복사
500 Internal Server Error: When there is an unexpected error during processing.